Results 1 to 5 of 5

How do I rename multiple sheet sets?

Threaded View

  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.


    Sub Search_Rename()
    Dim i As Long
    For i = 1 To Worksheets.Count
     i = i + 1
     If Sheets(i ).Name = air(n) Then Sheets(i ).Name = Sheets(i).Name = "air(" & i & ")"  'This line I can't figure out syntax for if statement air(n)
         Cell(3,4)=i
    If Sheets(i ).Name = Gound(n) Then Sheets(i ).Name = Sheets(i).Name = "ground(" & i & ")"  'This line I can't figure out syntax for if statement ground(n)
          Cell(8,9)=i
    Next i
    End Sub
    Last edited by dominicb; 01-15-2008 at 07:50 AM.

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