+ Reply to Thread
Results 1 to 5 of 5

VBA - Creating a new named sheet with a sheet template

  1. #1
    Registered User
    Join Date
    01-09-2012
    Location
    Thetford, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    VBA - Creating a new named sheet with a sheet template

    Example Sheet.xlsHello everyone,

    I am relatively new to VBA and would like to know how to create a new sheet automatically. I have a workbook to be used to create quotations for customers with two sheets, the first is a form in which the customer selects various options relating to the product they would like and the second is a template for a printout page. Each different item that a customer buys needs a separate printout sheet in the format of the template sheet. What I would like is a way to use vba to create sheets for new items, for example when the user enters item number "2" on the form sheet a new sheet is created with the format of the printout template and the sheet name "Item 2", however if a sheet for that item number already exists the form outputs the data on to the existing sheet rather than creating a new one.

    Thanks in advance for your help,

    Glen
    Last edited by Glensafro; 01-09-2012 at 06:49 AM. Reason: Solved

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA - Creating a new named sheet with a sheet template

    Welcome to the Forum.

    It will be great if you attach a sample workbook and we can help you faster.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: VBA - Creating a new named sheet with a sheet template

    As Arlette says, it would help to post a workbook so we can see what you are trying to do

    This code could help to get you started. It assumes that the order details are in cell A1 of the sheet called “Sheet1”, while the workbook also includes a sheet called “template”. It will create a copy of the template sheet and give it a name identical to the contents of cell A1 unless a sheet with that name already exists.


    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-09-2012
    Location
    Thetford, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: VBA - Creating a new named sheet with a sheet template

    Sorry for the delay in uploading this, busy morning here! I have mocked up a basic example of the printout form, final design is yet to be given to me to make so it is pretty basic, but the form information is more complete.

  5. #5
    Registered User
    Join Date
    01-09-2012
    Location
    Thetford, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: VBA - Creating a new named sheet with a sheet template

    Okay so I have just had a chance to run the code posted by NickyC and it works a treat, thanks guys appreciate the help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1