View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Cheri Cheri is offline
external usenet poster
 
Posts: 53
Default Automatically Name Tabs from List on Worksheet Named Team

I have 20 worksheets but there will not always be 20 names in the list. What
code can I add that will stop the macro if it runs out of names in the list
so that the "debug" error does not pop up?

Also, is there a way that once the worksheets have been renamed, if the list
changes for any reason (new employees, etc.) the macro will still name the
tabs from the new list even though the tabs are not named worksheet1,
worksheet2, etc.?

"Don Guillett" wrote:

See if this idea helps

Sub namesheets()
For i = 1 To 18
Sheets("sheet" & i).Name = Cells(i, "a")
Next i
End Sub

--
Don Guillett
SalesAid Software

"Cheri" wrote in message
...
I am wanting to automatically name all sheet tabs from a list I have
created
on a worksheet named Team. I have set up 18 sheets currently named Sheet1
through Sheet18 (besides the first two named Team and Stats).

I would like to have each tab renamed respectively according to the list I
have on the Team tab in cells A1 through A18.

I have tried a couple other tips on here but they merely add more sheets
and
I have data on the current sheets that I want to rename.

Thanks,
Cheri