ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Renaming Worksheets (https://www.excelbanter.com/excel-programming/301672-renaming-worksheets.html)

rbanks[_10_]

Renaming Worksheets
 
I'm a novice with VBA macros, 1st off.

I'm continually creating workbooks with 100 or more tabs, but need
quick way to rename each tab.

In each worksheet, I have the name I want on the tab stored in cel
A1.

Can someone tell me how to create a macro that will rename each shee
to the value in cell A1 of that same sheet?

Thanks

Windows 2000
Excel 200

--
Message posted from http://www.ExcelForum.com


medialint[_2_]

Renaming Worksheets
 
Easy enough

Sub RenameSheetsToA1()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Name = ws.Cells(1, 1)
Next
End Sub

"rbanks " wrote:

I'm a novice with VBA macros, 1st off.

I'm continually creating workbooks with 100 or more tabs, but need a
quick way to rename each tab.

In each worksheet, I have the name I want on the tab stored in cell
A1.

Can someone tell me how to create a macro that will rename each sheet
to the value in cell A1 of that same sheet?

Thanks

Windows 2000
Excel 2000


---
Message posted from http://www.ExcelForum.com/



Bob Phillips[_6_]

Renaming Worksheets
 

For Each sh In ActiveWorkbook.Worksheets
sh.Name = sh.Range("A1").Value
Next sh

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"rbanks " wrote in message
...
I'm a novice with VBA macros, 1st off.

I'm continually creating workbooks with 100 or more tabs, but need a
quick way to rename each tab.

In each worksheet, I have the name I want on the tab stored in cell
A1.

Can someone tell me how to create a macro that will rename each sheet
to the value in cell A1 of that same sheet?

Thanks

Windows 2000
Excel 2000


---
Message posted from http://www.ExcelForum.com/





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

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