naming multiple tabs in excel 200e

March 6, 2012 at 07:32:30
Specs: Windows XP
I have a workbook that has 62 tabs in it. Each tab needs to labeled 1 day, 1 night, 2 day, 2 night, 3 day, 3 night all the way through 31. The spread sheet has many different fromulas for many different areas in our process. I have a macro that will generate the sheets from the original, but I do not know how to get the tabs labeled correctly without manually doing each one. Would appreciate any help.

See More: naming multiple tabs in excel 200e

Report •

#1
March 6, 2012 at 14:56:00
Sub NameSheets()
 For shtNum = 1 To Sheets.Count
  myCount = myCount + 1
     Sheets(shtNum).Name = myCount & " day"
     Sheets(shtNum + 1).Name = myCount & " night"
        shtNum = shtNum + 1
 Next
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
March 7, 2012 at 04:11:02
Thank you, thank you, thank you !! I had to take the +1 out of line 5, but it works perfectly. I wish you only knew the time you are saving me as I'm always changing spreadsheets mid way through the month and having to copy and relabel them. Thanks again.


Report •

#3
March 7, 2012 at 07:02:22
I'm not sure which line you are calling "line 5" but I can say that if you take +1 out of any line, the code will not do what you asked for in your original post.

In addition, the code probably throw up an error (as it did for me) since it will try to rename more than one sheet with the same name.

I'm curious as to what you did because, as I said, based on your OP, both +1 entries are required.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

Related Solutions

#4
March 7, 2012 at 11:06:46
You are correct, I just didn't get a chance to get back to the post. Sorry for doubting, not sure why it didn't run the first time, but it does exactly what you said it would. I have been using it all day, once again, thanks for the help !

Report •

Ask Question