• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Very Hidden Sheets

LB

New Member
I have a macro that unhides all sheets with a loop.


For Each ws In ActiveWorkbook.Sheets

ws.Visible = True

Next ws


But, I have 2 sheets that need to remain "very hidden" & I can't seem to figure that out. Help please!!!

LB
 
Narayan, I appreciate your quick response & I tried several variations of it & still couldn't get it to work. Here's the full macro, what did I do wrong?


Sub UnhideAll()


Application.ScreenUpdating = False


For Each ws In ActiveWorkbook.Sheets

ws.Visible = True

Next ws


Sheets("data", "instruct").Select

ActiveWindow.SelectedSheets.Visible = xlVeryHidden


Sheets("FLNA").Select

Range("A1").Select


End Sub
 
Hi ,


Try this :

[pre]
Code:
Sub UnhideAll()

Application.ScreenUpdating = False

For Each ws In ActiveWorkbook.Sheets
ws.Visible = True
Next ws

Sheets("data").Visible = xlVeryHidden
Sheets("instruct").Visible = xlVeryHidden

Sheets("FLNA").Select
Range("A1").Select

End Sub
[/pre]
Narayan
 
If they are already very hidden then you can skip them from the loop like below:

[pre]
Code:
Public Sub HideSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Select Case ws.Name
Case "data" 'Do Nothing
Case "instruct" 'Do Nothing
Case Else
ws.Visible = xlSheetVisible
End Select
Next ws
End Sub
[/pre]
 
Back
Top