Rename selected (highlighted) sheet with cell contents of sheets in cell A1

T

transferxxx

How can i modify macro below - to make it work for only sheets i've
selected (group) - instead of all sheets in active workbook.

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

Thxs
 
J

Joerg

Sub RenameWS()
Dim ws As Worksheet
For Each ws In ActiveWindow.SelectedSheets
ws.Activate
ws.Name = Range("A1").Value
Next
End Sub

Cheers,
Joerg Mochikun
 
T

transferxxx

thxs!!

Sub RenameWS()
Dim ws As Worksheet
For Each ws In ActiveWindow.SelectedSheets
ws.Activate
ws.Name = Range("A1").Value
Next
End Sub

Cheers,
Joerg Mochikun
 

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