+ Reply to Thread
Results 1 to 3 of 3

Adding new tabs, renaming it and adding info

  1. #1
    Registered User
    Join Date
    07-21-2011
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2003
    Posts
    1

    Adding new tabs, renaming it and adding info

    Hello,

    I'm working on an Excel tool that would allow me to visualize the status of different projects. Each project is contained in a separate tab named after its position (there are at the moment 12 projects so the next new project will be in a tab named "13", the next on a tab "14" and so on). There's also a first tab named "overview" which has a table where all the project names and some information about the projects. Note that this "overview" tab doesn't contain actual data, but links to the project tabs.
    Since the file will be used by other people, I'm working in a macro to automate the process of adding a new project, which entails the following:
    1. Creating new tab and renaming it accordingly (note that besides the project tabs there are other tabs which are not relevant for the macro. Note also that project tabs are the only named with only numbers).
    2. Copying the project template into the new tab from the "template tab"
    3. Dialog box asks for project information (name, person in charge, department) and copies it into cells in new project tab
    4. Adding a new row in tab "overview" table and setting the links from new project tab.

    So far I’ve managed to do what I assume is the easy part: creating dialog box, buttons, and using macro recording for getting the code lines of the “copy, paste, add row, add new tab, etc” stuff.
    What I’m missing is the part where the macro knows what number comes next to rename the tab of new project, in what position should the macro add the new row in “overview” tab, setting up the links in the new row from the new tab (there could be 20 new more projects in the future or maybe 2, I can’t know that).

    Can someone please give me a hand? I would much appreciate it.
    Hope the explanation works!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Adding new tabs, renaming it and adding info

    With no sample sheet to look at, a lot of assumptions here.

    Assuming the Overview sheet has these "numeric tab names" in column A and the last value going down that column is the current last project sheet, several things become possible:

    1) To spot the last row with a "tab name" in it in column A:
    Please Login or Register  to view this content.
    So now MaxSH now has the current last sheet name.

    2) To set a variable for the next sheetname:
    Please Login or Register  to view this content.

    3) Now you can copy your template sheet and name it accordingly:
    Please Login or Register  to view this content.

    4) And enter this on the overview sheet:
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 07-21-2011 at 11:15 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Adding new tabs, renaming it and adding info

    Dialog boxes aren't too hard:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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