![]() |
Rename selected (highlighted) sheet with cell contents of sheets in cell A1
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 |
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 |
Rename selected (highlighted) sheet with cell contents of sheets in cell A1
thxs!!
Joerg wrote: 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 |
All times are GMT +1. The time now is 04:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com