Renaming Worksheets

R

rbanks

I'm a novice with VBA macros, 1st off.

I'm continually creating workbooks with 100 or more tabs, but need
quick way to rename each tab.

In each worksheet, I have the name I want on the tab stored in cel
A1.

Can someone tell me how to create a macro that will rename each shee
to the value in cell A1 of that same sheet?

Thanks

Windows 2000
Excel 200
 
M

medialint

Easy enough

Sub RenameSheetsToA1()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Name = ws.Cells(1, 1)
Next
End Sub
 
B

Bob Phillips

For Each sh In ActiveWorkbook.Worksheets
sh.Name = sh.Range("A1").Value
Next sh

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top