I have written a Macro that will select all but the last 2 sheets. I need it to be the Active Sheets, which it is doing, but if I have sheets hidden, it gives me the dreaded 400 Error. If sheets are not hidden, it runs perfectly. I am at a loss, what am I missing?
Code:
As with Your previous thread >>> use code - tags <<<
Code:
As with Your previous thread >>> use code - tags <<<
Code:
Sub SelectAllSheets()
Dim x As Integer
ThisWorkbook.Worksheets(2).Select
For x = 1 To ((ThisWorkbook.Worksheets.Count) - 2)
Worksheets(x).Select (False)
Next x
End Sub
Attachments
Last edited by a moderator: