I have multiple worksheets that I need to run the same macro on. I've tried several code examples I found online to do this, but none of them will work using my code (which works fine on individual worksheets). They work fine when running "as is", but won't cycle through the worksheets when I insert my code. The macro just keeps running on the first worksheet multiple times instead of stepping through them!?
Here's some simple code I tried that worked fine "as is"...
Public Sub BoldAllSheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Range("1:1").Font.Bold = True
Next ws
End Sub
When I replace ws.Range("1:1").Font.Bold = True with my code it will NOT cycle through the worksheets. Again, it just runs multiple times on the first worksheet. I can email files/code if needed. Any help would be much appreciated.
Here's some simple code I tried that worked fine "as is"...
Public Sub BoldAllSheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Range("1:1").Font.Bold = True
Next ws
End Sub
When I replace ws.Range("1:1").Font.Bold = True with my code it will NOT cycle through the worksheets. Again, it just runs multiple times on the first worksheet. I can email files/code if needed. Any help would be much appreciated.