jpl458
jpl458

Reputation: 615

EXCEL can't unhide hidden sheet

Trying to create a workbook that gets data from ACCESS. I can open the workbook and was adding some code to auto open in excel. But when i tried to edit it keeps telling me that I must unhide hidden work sheet. And the unhide command is grayed out. When I first set it up I selected Personal Workbook, which I think applies to any book I open. Along the way I kept deleting workbooks in order start over, so I think there is nothing really to delete. I wanted to add this code to to auto start but I can't get to the code. The follwing code is supposed to unhide all hidden workboks/sheets:

     Sub Viewit()
     Dim Ws As Worksheet
     Application.ScreenUpdating = False
     For Each Ws In Worksheets
     Ws.Visible = True
     Next Ws
     Application.ScreenUpdating = True
     End Sub

Looking for a better solution and what I am doing that is wrong.

Thanks

Upvotes: 0

Views: 523

Answers (1)

Solar Mike
Solar Mike

Reputation: 8375

There is a very hidden level :

ActiveWorkbook.Sheets("sheet name").Visible = xlSheetVeryHidden

Or xlSheetVeryVisible for the opposite effect

Note this level is only controllable through vba, but functions can work with cells on very hidden sheets.

Upvotes: 2

Related Questions