Hi,
I have a macro that does the following:-
Rather than running the macro on all the sheets in the workbook, I only want it to run on sheets that start Shee*
I am sure the line For Each ws In Worksheets needs to be changed, but I haven’t got a clue of what to do to just run on specific sheets
Any help would be appreciated.
Thanks
I have a macro that does the following:-
VBA Code:
Sub A_RenameSheets()
Dim ws As Worksheet
Path = ThisWorkbook.Path & "\"
On Error GoTo err_chk
For Each ws In Worksheets
If Len(Trim(ws.Range("B4"))) > 0 Then ws.Name = ws.Range("B4").Text
Next ws
On Error GoTo 0
Exit Sub
err_chk:
MsgBox "Error #:" & Err.Number & ": " & Err.Description, vbOKOnly, "ERROR RENAMING " & ws.Name
Err.Clear
Resume Next
End Sub
Rather than running the macro on all the sheets in the workbook, I only want it to run on sheets that start Shee*
I am sure the line For Each ws In Worksheets needs to be changed, but I haven’t got a clue of what to do to just run on specific sheets
Any help would be appreciated.
Thanks
Last edited by a moderator: