-1

I am creating a spreadsheet to record unit finances. The spreadsheet I am using as a template/demo for mine has a hidden worksheet that I'm trying to view.

I have googled, and tried what has been suggested, including VBA.

What can I do to see this worksheet? (I would upload the file, but I don't know how)

Roz Jones
  • 1
  • 2

1 Answers1

0

For a specific sheet:

Worksheets("MySheet").Visible = xlSheetVisible

Make all sheets in the workbook visible:

Sub MakeAllSheetsVisible()
    Dim sht As Worksheet

    For Each sht In Worksheets
        If Not sht.Visible Then
            sht.Visible = xlSheetVisible
        End If
    Next sht
End Sub
Alex P
  • 12,249
  • 5
  • 51
  • 70
  • I've tried this, but I get the error 'Compile error: Invalid outside procedure' – Roz Jones Jan 21 '18 at 20:00
  • Which code snippet are you running and where? You’ve placed inside a Sub...End Sub right? – Alex P Jan 21 '18 at 20:29
  • Yes. I copied all of the above as it says there. I changed the "MySheet" to "Sheet5" – Roz Jones Jan 21 '18 at 21:03
  • Just to be clear, the code snippets are separate i.e. you use one or the other. If you used the first one make sure you wrap it within Sub...End Sub – Alex P Jan 21 '18 at 21:15
  • I'm getting: "Runtime Error 1004: Method 'Visible' of object '_Worksheet' failed. When I go to debug, the line 'she.Visible - xlSheetVisible' is highlighted – Roz Jones Jan 22 '18 at 15:19
  • Is the `sht` you get the error on password protected? – Alex P Jan 22 '18 at 15:52
  • I have removed the password, but it still won't work – Roz Jones Jan 22 '18 at 18:06
  • In which case I am stuck for what to do next...I can't think what else this could be. Works on my machine perfectly well. – Alex P Jan 22 '18 at 19:01