Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide range of worksheets in a workbook
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide range of worksheets in a workbook
I think that should be
For Each ws In Activeworkbook.Worksheets If ws.Name < "Sheet1" Then ws.Visible = xlVeryHidden End If Next -- HTH RP (remove nothere from the email address if mailing direct) "Toppers" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hide/Unhide worksheets upon entries in a range of the main worksheet | Excel Discussion (Misc queries) | |||
using the same range name on different worksheets in a workbook | Excel Discussion (Misc queries) | |||
Protect or Hide all worksheets in a workbook except 1 | Excel Worksheet Functions | |||
How can I hide multiple worksheets that are in a workbook? | Excel Discussion (Misc queries) | |||
Is there a way to hide worksheets and/or rows/columns based on information enter into a particular cell of range of cells? | New Users to Excel |