View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Hide range of worksheets in a workbook

Try this but note that there must be one visible worksheet; change "Sheet1"
to suit.

For Each ws In Worksheets
If ws.Name < "Sheet1" Then
ws.Visible = False ( or xlVeryHidden)
End If
Next

HTH

"AuthorizedUserPF" wrote:

Good afternoon;

I have two macros that I created some time ago that Hides and Unhides
specific sheets in a workbook.

I want to be able to hid and unhide all the sheets in a workbook, regardless
of what they are named.

The line I am having trouble with is:

Sheets("Sheet1").Visible = xlVeryHidden

What can I replace "Sheet1" with to make all the sheets, regardless of their
name very hidden?

Thanks and regards
Phil