Macro to rename all worksheets with cell value in each sheet

M

Max

Hi guys,

I need help for a macro to loop through all worksheets (identical
structure), copy the contents of B2 and rename the sheet with it, all at one
go. B2 will hold text (different for each sheet). I'm using xl97.

TIA
Max
 
M

Max

Many thanks, Neil!
It runs smoothly.

Neil said:
Max,
Try this

Sub RenameWS()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Activate
ws.Name = Range("B2").Value
Next
End Sub

Neil
 

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