ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Automatic worksheet name from cell on that worksheet (A2) (https://www.excelbanter.com/excel-discussion-misc-queries/115021-automatic-worksheet-name-cell-worksheet-a2.html)

Rob

Automatic worksheet name from cell on that worksheet (A2)
 
I have a workbook with 20+ worksheets and want each tab to reflect what is in
A2 of the respective worksheet.

Gary''s Student

Automatic worksheet name from cell on that worksheet (A2)
 
After verifying that the names in A2 are valid worksheet names, run:

Sub wwwwwnameit()
Dim w As Worksheet
For Each w In Worksheets
w.Activate
w.Name = Range("A2").Value
Next
End Sub
--
Gary''s Student


"Rob" wrote:

I have a workbook with 20+ worksheets and want each tab to reflect what is in
A2 of the respective worksheet.



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

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