VBA: Unhide Very Hidden Sheet

bamaisgreat

Well-known Member
Joined
Jan 23, 2012
Messages
823
Office Version
  1. 365
Platform
  1. Windows
I sheet 9 very hidden. How can i adjust code so it will run properly.
Thanks as always


Code:
Sub unhide_9()
'
' unhide_9 Macro
'
    With Worksheets("Sheet9")
        .Visible = xlSheetVisible
        .Select
        Application.Wait Now + #12:00:12 AM#
        Worksheets("BURN").Select
        .Visible = xlSheetHidden
    End With
    
End Sub
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
code works for me..meaning it executes without any error.

It UNhides Sheet9
Selects Sheet9
Waits 12 seconds
selects BURN
Hides Sheet9


In what way does it not work for you?
 
Upvote 0
If you want to unhide sheet 9 use

Sheets("Sheet9").Visible = True

Try this:

Code:
Sub Unhide_9()

  Sheets("Sheet9").Visible = True
  Application.Wait Now + #12:00:12 AM#
  Sheets("Burn").Visible = False

End Sub
 
Upvote 0
It is irrelevant if the sheet is currently visible hidden or veryhidden.
When you apply a visible property to a sheet, it doesn't matter what the current state the visible property is, it just does it.
 
Upvote 0
Hi,

The original code you posted works for me wether it was hidden or very hidden.

.Visible = True
or
.Visible = xlSheetVisible

makes no difference for me
kind regards,
Erik

EDIT: for some reason didn't see jonmo1's post before submitting mine
 
Upvote 0
oh ok, so will it put it back to the veryhidden state at the end of the code ??
Sub unhide_9()
'
' unhide_9 Macro
'
With Worksheets("Sheet9")
.Visible = xlSheetVisible
.Select
Application.Wait Now + #12:00:12 AM#
Worksheets("BURN").Select
.Visible = xlSheetHidden
End With

End Sub
 
Upvote 0
so are you asking for a way to put it back to whatever it was originally?

If at the beginning it was hidden, then at the end you want it hidden
If at the beginnign it was veryhidden, then at the end you want it veryhidden


Try
Code:
Sub unhide_9()
'
' unhide_9 Macro
'
Dim OrigState As Variant
    With Worksheets("Sheet9")
        OrigState = .Visible
        .Visible = xlSheetVisible
        .Select
        Application.Wait Now + #12:00:12 AM#
        Worksheets("BURN").Select
        .Visible = OrigState
    End With
    
End Sub
 
Upvote 0
yes, the code showed it was only hidden. But I want change the entire module as if the sheet was veryhidden
 
Upvote 0
Are you just wanting to change it to

Rich (BB code):
Sub unhide_9()
'
' unhide_9 Macro
'
    With Worksheets("Sheet9")
        .Visible = xlSheetVisible
        .Select
        Application.Wait Now + #12:00:12 AM#
        Worksheets("BURN").Select
        .Visible = xlVeryHidden
    End With
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top