+ Reply to Thread
Results 1 to 5 of 5

Change sheet index numbers in VBA?

Hybrid View

  1. #1
    Registered User
    Join Date
    12-05-2006
    Location
    Philadelphia PA
    MS-Off Ver
    Office 365
    Posts
    81

    Change sheet index numbers in VBA?

    Two-part question:

    1 Does Excel process worksheets (tabs) in the left-to-right order in which the tabs appear visually? Or in the order of the worksheets' index numbers as they appear in the VBE Project Explorer window?

    2 Is there a way to renumber or reassign index numbers to specific worksheets?

    Thanks for your advice.
    Last edited by batman; 10-25-2009 at 09:58 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Is it possible to change sheet index numbers in VBA?

    The index of sheets is the left-to-right order in which they appear.

    You can change the index by reordering the sheet.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    12-05-2006
    Location
    Philadelphia PA
    MS-Off Ver
    Office 365
    Posts
    81

    Re: Is it possible to change sheet index numbers in VBA?

    Thanks shg,
    There's an old saying: experience (and knowledge) is something you get right after you really needed it. I had always assumed that the index order of worksheets was that which appeared in the VBE project window, i.e. sheet1 had index 1, sheet2 had index 2, etc. No matter what I did I couldn't get the sheet numbers in VBE to follow the same order as the tabs, regardless of how they were named.

    Shortly after seeing your note I experimented further with my multi-sheet application. And sure enough, the index numbers tracked the tab order. Now I've been able to simplify some aspects by using Worksheets(index) instead of Worksheets("name"). I guess that the Sheet# in VBE identifies the order in which they were created, regardless of the way they may have been rearranged.

    I consider this matter to be resolved, and the thread can be marked solved.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Change sheet index numbers in VBA?

    and the thread can be marked solved.
    Great. Would you please do so?

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

    Re: Change sheet index numbers in VBA?

    This might help understand sheets names


    http://excel-it.com/SheetName.htm
    Hope that helps.

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

    Free DataBaseForm example

+ 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