Macro to rename all worksheets with cell value in each sheet

  • Thread starter Thread starter Max
  • Start date Start date
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
 
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
 
Back
Top