VBA: Hide and Unhide Problem

bamaisgreat

Well-known Member
Joined
Jan 23, 2012
Messages
821
Office Version
  1. 365
Platform
  1. Windows
When I run the code below i always get a error. I just simply want to unhide sheet9 for 5 seconds then hide it and return back to sheet Burn.
Code:
  Sheets("Sheet9").Select
    ActiveWindow.SelectedSheets.Visible = True
    Application.Wait Now + TimeSerial(0, 0, 5)
    
  
   
    Sheets("Sheet9").Visible = False
    Sheets("BURN").Select
End Sub
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
When I run the code below i always get a error. I just simply want to unhide sheet9 for 5 seconds then hide it and return back to sheet Burn.
Code:
  Sheets("Sheet9").Select
    ActiveWindow.SelectedSheets.Visible = True
    Application.Wait Now + TimeSerial(0, 0, 5)
    
  
   
    Sheets("Sheet9").Visible = False
    Sheets("BURN").Select
End Sub
You're trying to select a sheet that is hidden. Why not:
Sheets("Sheet9").Visible = True to unhide it?
 
Upvote 0
Code:
    With Worksheets("Sheet9")
        .Visible = xlSheetVisible
        .Select
        Application.Wait Now + #12:00:05 AM#
        Worksheets("BURN").Select
        .Visible = xlSheetHidden
    End With
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,078
Latest member
skydd

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