Question about For Each ws in Worksheets
You could try this. I do agree with Don, I wouldn't think it is neccessary
to activate each sheet to do the actions. It may make your code more
efficient.
' this will exclude the named worksheet
Private Sub Test()
For Each ws in Worksheets
If Not ws.Name Is "Hidden Sheet Name" Then
ws.Activate
[actions]
End If
Next ws
End Sub
or
' this will exclude all hidden worksheets
Private Sub Test()
For Each ws in Worksheets
If Not ws.Visible = False Then
ws.Activate
[actions]
End If
Next ws
End Sub
--
Cheers,
Ryan
"Orion Cochrane" wrote:
I have a reporting program I wrote on Excel. Basically, what it does is
generate reports for accounting purposes based on activity. I have a sheet I
want hidden, as no one needs it but me for data validation. Here is a snippet
of my macro:
Private Sub Test()
For Each ws in Worksheets
ws.Activate
[actions]
End Sub
My question is in the ws.Activate line: Using this line, will it activate my
hidden sheet? If so, I can work around that. Thanks.
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so we
know when we have answered your questions. Thanks.
|