I'm trying to rename several tabs in a workbook to the text in cell G30. This code does not work:
Sub RenameTabsToNames()
For i = 1 To Sheets.Count
If Worksheets(i).Range("G30").Value <> "" Then Sheets(i).Name = Worksheets(i).Range("G30").Value Else: Sheets(i).Name = "RENAME MANUALLY"
Next
End Sub
This part is highlighted when the debugger runs:
Sheets(i).Name = Worksheets(i).Range("G30").Value Else
Thank you for any help!
Bookmarks