You can refer to the current sheet that is visible as the "ActiveSheet" regardless of its name or Codename. If you want to run a macro on the visible sheet, just refer to it as the 'ActiveSheet'. If you want to run the same macro on all the sheets, you can use a loop similar to this:
Sub Test()
Dim ws As Worksheet
For Each ws In Sheets
With ws
'your code using dot notation
End With
Next ws
End Sub
When you loop through all the sheets, you don't need to know their names because they are accessed using the variable 'ws'. I hope this helps.
Bookmarks