Hello!
I am trying to write a macro to loop through all the sheets in a workbook, and if a cell is a certain value, rename the worksheet. Here is what I have so far:
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Activate
If Sheet.Range("B1").Value = "Rename me" Then
ActiveSheet.Name = "NewName"
End If
Next Sheet
My question is, is there a way to accomplish this without having to activate every sheet every time?
Thanks for the help!
I am trying to write a macro to loop through all the sheets in a workbook, and if a cell is a certain value, rename the worksheet. Here is what I have so far:
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Activate
If Sheet.Range("B1").Value = "Rename me" Then
ActiveSheet.Name = "NewName"
End If
Next Sheet
My question is, is there a way to accomplish this without having to activate every sheet every time?
Thanks for the help!