View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Joerg Joerg is offline
external usenet poster
 
Posts: 138
Default Rename selected (highlighted) sheet with cell contents of sheets in cell A1

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


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