Excel Unhide Pages

  dogbreath1 15:01 18 Jan 11
Locked

I used a macro to hide all but one page of a six page spreadsheet. Can't seem to disable it to review and edit the hidden pages. Help please.

  scotty 16:27 18 Jan 11

Have you tried Format/Sheet/Unhide?

  VoG II 16:32 18 Jan 11

You may have made them Very Hidden. Try this macro


Sub UnhideSheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
End Sub

  dogbreath1 16:53 18 Jan 11

Thanks, VoG™.

Sorted.

  dogbreath1 15:42 18 May 11

The work that I needed to do on the now unhidden sheets is complete.

It is a six sheet workbook, which has a user interface on sheet 1, a 'Macros Must Be Enabled' message on sheet 6 (which shows if macros aren't enabled when the workbook is opened) and the remaining sheets 2-5 inclusive I want to make very hidden.

How do achieve this?

  VoG II 15:48 18 May 11

Try this

Sub HideSheets()

Dim i As Long

For i = 2 To 5

Sheets(i).Visible = xlSheetVeryHidden

Next i

End Sub

  dogbreath1 17:03 18 May 11

Thanks, VoG™, but placing that macro in the 'This Workbook (Code)' has no visible effect.

  dogbreath1 17:07 18 May 11

Just thinking aloud. The sheets were previously 'very hidden'.

You previously gave me the following to unhide them:

Sub UnhideSheets() Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets ws.Visible = xlSheetVisible Next ws End Sub

Would that have removed the previous macro, or just disabled it? Could it just be reversed?

  VoG II 17:13 18 May 11

Put the code in a regular module then run it.

  dogbreath1 17:24 18 May 11

OK.

Got "Run time error '1004'

Unable to set visible property of the worksheet class"

The debug pointed the error to:

Sheets(i).Visible = xlSheetVeryHidden

  VoG II 17:40 18 May 11

That code works for me. Is the workbook structure protected?

This thread is now locked and can not be replied to.

Surface Pro (2017) vs Surface Pro 4

Where HTML5 is headed next

MacBook Pro v Surface Pro 5