Auto worksheet name?

E

Esradekan

On the first sheet (named 'Index') of the workbook in cells B2-B21 I
have a list that changes from year to year. I need to have a
worksheet named from each of the names in the list and need to have
the rest of the worksheets in the book named accordingly. (ie B2 =
Sheet2, B3 = Sheet3 etc etc) Can this be done? and if so, how? Im
using Excel 2010 in a macro enabled book.

Hope someone can help.

TIA
 
G

Gord

Sub NameWS()
'name sheets with list in B2:B21 on first sheet
On Error Resume Next
For i = 2 To Worksheets.Count
Sheets(i).Name = Sheets(1).Cells(i, 2).Value
Next i
End Sub


Gord Dibben Microsoft Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top