Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding and Unhiding work sheets
Frank, here is one way,
Sub HideAll() 'will hide all sheets except sheet 1 For Each sh In Worksheets If Not sh.Name = "Sheet1" Then sh.Visible = xlHidden End If Next sh End Sub -- Paul B Always backup your data before trying something new Using Excel 2000 & 97 Please post any response to the newsgroups so others can benefit from it ** remove news from my email address to reply by email ** "Frank" wrote in message ... I know by using the following code I can un-hide all work sheets, Sub sheetunhide() For Each sh In Sheets sh.Visible = True Next sh End Sub I also want to be able to hide all sheets except a specific one, does anyone know how to do this. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding and Unhiding work sheets
I know by using the following code I can un-hide all work
sheets, Sub sheetunhide() For Each sh In Sheets sh.Visible = True Next sh End Sub I also want to be able to hide all sheets except a specific one, does anyone know how to do this. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding and Unhiding work sheets
Try this Frank
It will hide all sheets except Sheet1 Sub sheetunhide() For Each sh In ThisWorkbook.Sheets If sh.Name < "Sheet1" Then sh.Visible = False End If Next sh End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Frank" wrote in message ... I know by using the following code I can un-hide all work sheets, Sub sheetunhide() For Each sh In Sheets sh.Visible = True Next sh End Sub I also want to be able to hide all sheets except a specific one, does anyone know how to do this. Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding and Unhiding work sheets
Frank
untested, but something like: Sub SheetHide() For Each sh In Sheets If sh.name < "xxxx" Then sh.Visible = False End If Next sh End Sub Bear in mind that at least one sheet must be visible. Regards Trevor "Frank" wrote in message ... I know by using the following code I can un-hide all work sheets, Sub sheetunhide() For Each sh In Sheets sh.Visible = True Next sh End Sub I also want to be able to hide all sheets except a specific one, does anyone know how to do this. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
toolbar "button" for hiding/unhiding sheets | Excel Worksheet Functions | |||
Hiding / Unhiding Sheets | Excel Discussion (Misc queries) | |||
need code for hiding/unhiding sheets using checkboxes | Excel Worksheet Functions | |||
Hiding and unhiding sheets | Excel Discussion (Misc queries) | |||
Hiding/Unhiding | Excel Worksheet Functions |