Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
toolbar "button" for hiding/unhiding sheets Barb in MD Excel Worksheet Functions 2 February 10th 10 01:45 AM
Hiding / Unhiding Sheets Larry Fitch Excel Discussion (Misc queries) 1 December 2nd 09 02:42 PM
need code for hiding/unhiding sheets using checkboxes pzx8hf Excel Worksheet Functions 1 August 13th 08 12:11 AM
Hiding and unhiding sheets D.Hay Excel Discussion (Misc queries) 2 December 10th 05 03:59 PM
Hiding/Unhiding Bobby Excel Worksheet Functions 2 May 25th 05 10:40 PM


All times are GMT +1. The time now is 03:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"