Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Any way to get this to work? I want the worksheets to rename based on the
values or cells F1 and G1 of each worksheet Sub Rename_Worksheets() ' ' Macro1 Macro ' Macro recorded 12/19/2005 by Cathy Baker ' ' 'This code runs to rename the worksheets Dim wks As String Dim Sh As Worksheet 'Application.ScreenUpdating = False wks = ActiveSheet.Name Const sStr As String = "F1 " & "G1" On Error GoTo ErrHandler For Each Sh In ThisWorkbook.Worksheets Sh.Name = Sh.Range(sStr).Value Next Sh Worksheets(wks).Activate Exit Sub ErrHandler: 'MsgBox "Cell" & sStr & "on sheet" & sh.Name & "is not valid sheet name" Resume Next 'Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Rename Many Worksheets at a time. | Excel Discussion (Misc queries) | |||
Rename Protected Worksheets | Excel Programming | |||
Rename worksheets with VBA | Excel Programming | |||
Rename worksheets | Excel Programming |