Renaming Worksheets

  • Thread starter Thread starter rbanks
  • Start date Start date
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
 
Easy enough

Sub RenameSheetsToA1()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Name = ws.Cells(1, 1)
Next
End Sub
 
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)
 

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

Back
Top