+ Reply to Thread
Results 1 to 5 of 5

How do I rename multiple sheet sets?

  1. #1
    Registered User
    Join Date
    01-15-2008
    Posts
    66

    How do I rename multiple sheet sets?

    Hi all,
    First timer here. I am given a workbook with hundreds of sheets with different names - air(2),air(4), ground(4), ground(28),ground(6), etc. I need to keep the text of the name but change the number associated with it. -air(1),air(2), ground(3), ground(4),ground(5). I am trying to consecutively number tabs without changing the text then add the number in a cell on that sheet. The renaming part of the following code seems to work, but- If Sheets(i).Name= "whatever" doesn't. Your help would be appreciated.


    Please Login or Register  to view this content.
    Last edited by dominicb; 01-15-2008 at 07:50 AM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon dsexpress

    ...and welcome to the forum!!

    This shouldn't be too difficult if the number is always contained in brackets - we just have to find the position of the opening parenthesis "(", and take the name of the sheet from the left of that character, and rebuild the end bit with an incrementing number in the brackets. Try this :

    Please Login or Register  to view this content.
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by dominicb
    Good afternoon dsexpress

    ...and welcome to the forum!!

    This shouldn't be too difficult if the number is always contained in brackets - we just have to find the position of the opening parenthesis "(", and take the name of the sheet from the left of that character, and rebuild the end bit with an incrementing number in the brackets. Try this :

    Please Login or Register  to view this content.
    HTH

    DominicB
    Hi, the original post made reference to the sheet number being stored in a cell on each sheet. Assuming the cell is consistent within each of the Air, Ground, ..whatever sheets, the following should work. The select case statement obviously wants adding to for the ...'whatever' sheets which presumably have a different cell reference which contains the sheet number.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834
    try
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-15-2008
    Posts
    66

    error if pages are moved

    If I bring named sheets into the workbook consecutively the code works. When I then move the order of the sheets within the book naming error appears. Can I change the sheet number without changing the name?

+ 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