ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to rename all worksheets with cell value in each sheet (https://www.excelbanter.com/excel-programming/271383-macro-rename-all-worksheets-cell-value-each-sheet.html)

Max

Macro to rename all worksheets with cell value in each sheet
 
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



Max

Macro to rename all worksheets with cell value in each sheet
 
Many thanks, Neil!
It runs smoothly.

Neil wrote in message
...
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


"Max" wrote in message
...
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








All times are GMT +1. The time now is 06:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com