A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

unhide sheet macro



 
 
Thread Tools Display Modes
  #1  
Old February 7th, 2004, 01:37 AM
Owen
external usenet poster
 
Posts: n/a
Default unhide sheet macro

I have some files with many hidden sheets. How do I
unhide ALL of the hidden sheets using the fewest steps?

I would think that I could select multiple sheets to
unhide but I can't. Instead, I have to manually go to the
menu and select: Format, Sheet, Unhide, select a sheet
name, OK; and do this over and over again.

Is there a macro that I can create so that it looks for a
hidden sheet (not a specifically named sheet as the names
vary from file to file), unhide it, then look for the next
hidden sheet and so on until all sheets are unhidden.

Hope there's an answer out there. Thanks.
  #2  
Old February 7th, 2004, 02:44 AM
Debra Dalgleish
external usenet poster
 
Posts: n/a
Default unhide sheet macro

The following macros will hide and unhide all the sheets in the
workbook. When hiding sheets, the last sheet will remain visible.

'=========================
Sub UnhideSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
End Sub
'==========================
Sub HideSheets()
On Error Resume Next
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Visible = xlSheetHidden
Next ws
End Sub
'===================

Owen wrote:
I have some files with many hidden sheets. How do I
unhide ALL of the hidden sheets using the fewest steps?

I would think that I could select multiple sheets to
unhide but I can't. Instead, I have to manually go to the
menu and select: Format, Sheet, Unhide, select a sheet
name, OK; and do this over and over again.

Is there a macro that I can create so that it looks for a
hidden sheet (not a specifically named sheet as the names
vary from file to file), unhide it, then look for the next
hidden sheet and so on until all sheets are unhidden.

Hope there's an answer out there. Thanks.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #3  
Old February 7th, 2004, 02:46 AM
Gord Dibben
external usenet poster
 
Posts: n/a
Default unhide sheet macro

Owen

Sub Show_Sheets()
Dim I As Integer
For I = 1 To ActiveWorkbook.Worksheets.Count
ActiveWorkbook.Worksheets(I).Visible = True
Next I
End Sub

Gord Dibben Excel MVP

On Fri, 6 Feb 2004 17:37:08 -0800, "Owen" wrote:

I have some files with many hidden sheets. How do I
unhide ALL of the hidden sheets using the fewest steps?

I would think that I could select multiple sheets to
unhide but I can't. Instead, I have to manually go to the
menu and select: Format, Sheet, Unhide, select a sheet
name, OK; and do this over and over again.

Is there a macro that I can create so that it looks for a
hidden sheet (not a specifically named sheet as the names
vary from file to file), unhide it, then look for the next
hidden sheet and so on until all sheets are unhidden.

Hope there's an answer out there. Thanks.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:12 PM.


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