+ Reply to Thread
Results 1 to 8 of 8

Tabs, Can I add multiple tabs and name then in a repeating number?

  1. #1
    Registered User
    Join Date
    09-27-2014
    Location
    Hawaii
    MS-Off Ver
    MS Office 2010
    Posts
    4

    Tabs, Can I add multiple tabs and name then in a repeating number?

    I'm working on a project that requires 191 tabs. My first tab has the totals, summed from the following 190 tabs. My first tab is named "TOTAL". The additional tabs need to be names for the apartment number in the building. For example 501, 502, 503, etc. Without physical clicking add tab 190 time and renaming it 190 times, is there a faster way to do it?

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Tabs, Can I add multiple tabs and name then in a repeating number?

    Put in a standard module, change the range of numbers (apartment numbers) and run:

    Please Login or Register  to view this content.
    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Tabs, Can I add multiple tabs and name then in a repeating number?

    Just a bit of input here. Are you really sure you need 190 sheets for this? They will be a nightmare to find and work with.

    This sounds like the classic error of designing what you want the output to be, before designing an easy input method.

    Without knowing what you want to do, I have a feeling that it will be simpler to have 1 data input sheet for all rooms, and then additional sheet/s for your summary/analysis.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Tabs, Can I add multiple tabs and name then in a repeating number?

    Completely agree with Ford.
    But you may try this......
    Open your workbook --> Press Alt+F11 to open VBA Editor --> Insert (on VBA editor) --> Module --> Paste the code given below on the opened code window --> Now Press F5 (Function Key) to run the code --> After the sheets are added, select the code and delete it ( I assume that you will not need it after adding the sheets) -->Done.
    Please Login or Register  to view this content.
    You may change the numbers in red as per your requirement.
    Last edited by sktneer; 10-01-2014 at 08:48 AM. Reason: Made correction in code as pointed out by abousetta.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Tabs, Can I add multiple tabs and name then in a repeating number?

    sktneer, ShNum should be Long as the OP is using Excel 2010. Excel will automatically convert integers to long so should code it that way to begin with.

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Tabs, Can I add multiple tabs and name then in a repeating number?

    Quote Originally Posted by abousetta View Post
    sktneer, ShNum should be Long as the OP is using Excel 2010. Excel will automatically convert integers to long so should code it that way to begin with.
    Thanks for pointing this out. I really didn't notice it. Thanks once again.

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Tabs, Can I add multiple tabs and name then in a repeating number?

    Yes, I read that it actually speeds up the code because when declaring it as long to begin with Excel doesn't have to spend time reassigning memory to the variable. Of course if there is going to be a mix of users (e.g. 2003 and 2010) then it becomes a judgment call.

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Tabs, Can I add multiple tabs and name then in a repeating number?

    As you can see I am still using Excel 2007 so not very much aware of the fact that how 2010 deals with the variables and data types.
    But thanks to Gurus like you who are always there to tell you right and wrong and guide you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] summing multiple sub-tabs where each sub tabs row data is not the same
    By waternut in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2014, 01:44 PM
  2. Replies: 0
    Last Post: 04-08-2013, 12:15 PM
  3. Copying values from multiple Tabs of a WB into corresponding Tabs of another WB using VBA
    By sanc.jobs2012 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-27-2012, 06:15 AM
  4. Replies: 6
    Last Post: 02-01-2012, 05:29 PM
  5. Search multiple tabs for number in string
    By smigom in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-11-2008, 02:36 AM

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