+ Reply to Thread
Results 1 to 8 of 8

Tab Creation

  1. #1
    Registered User
    Join Date
    07-22-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    18

    Tab Creation

    I would like to program a button that creates several sheets that are copies of a template sheet, but name them based off of the cells in another seperate sheet. In this manner the copies will have the same formatting as the template sheet, but be labeled indivdually according to the sheet the names are pulled from. I have included a dummy file below that simulates my situation. In this file the "senario sheet" contains the names for the copied sheets but the letters "A" and "B" are appended before the names to specify which copy is which. The copied sheets that I want to be created are highlighted in red. When the cell labeled "button" is double clicked, two copies should be created for each senario as shown in the dummy file, one with the letter "A" in front and one with the letter "B".

    Please let me know of any problems or ways in which I can be more specific.

    Thank you for your help.
    Attached Files Attached Files
    Last edited by shugg24; 08-13-2010 at 09:27 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Tab Creation

    Right click button sheet tab and View code.

    Please Login or Register  to view this content.
    By the way scenario has a C in it
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    07-22-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Tab Creation

    Thank you so much for the assistance haha and yea spelling has never been a strongpoint for me. You solved my problem both accurately and in a timely manner, I greatly appretiate it.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Tab Creation

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    07-22-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Tab Creation

    I apologize, I will mark it as solved but I had remaining questions that I was unable to post yesterday due to lack of time. I need to add a section to this code that checks for sheets that have been previously created. For example, if the user adds a scenario and then presses the button again the macro should check for the sheet names that already exist. In this manner, sheet names that have already been created will not be created again which causes an error. If anyone is able to assist me with this problem it would be greatly appretiated.

  6. #6
    Registered User
    Join Date
    07-22-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Tab Creation

    I am very close to solving this problem on my own but I cannot figure out how to check the current sheet name against ones that have already been created. I know that this will require a loop that includes an IF condition checking each current sheet name with the one that is of focus. If someone could help me with the syntax I should be able to edit my code from there.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Tab Creation

    Use a function to test for existence of sheet.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-22-2010
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Tab Creation

    THANK YOU ANDY!!! You have truly haleped me with this project. I will be sure to credit you for the code.

+ 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