Display worksheet while User Form Hides

TriGuy51

New Member
Joined
Mar 23, 2010
Messages
25
This code does not work to unhide a worksheet and show it while the user form is hidden. What code will work?

worksheetname.visible=True
worksheetname.Activate
UserForm.Hide
Application.OnTime Now TimeValue("00:00:10") "Show1"

Where Show1 is a subroutine that reshows the User Form.

Help!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
this may give you some food for thought:
Code:
Sub showhide()
    UserForm1.Hide 'or whatever name you gave your userform
    Worksheets("Sheet1").Visible = True 'or whatever is the name of you sheet
    'place code here
    Worksheets("sheet1").Visible = True
    UserForm1.Show
End Sub
 
Upvote 0
It didn't work. It doesn't matter where I place the userform.hide statement.
A couple of things,
what does happen?
are you using userform.hide or userform1.hide? You need to use the name of your form which the default would be userform1
next - it does matter where you put the code. It should be in the form and you can get to it by pressing F7 when you are in the form.
 
Upvote 0
Yes, the code is in the form. Yes the name of the user form is correct.
No, the problem is still a mystery.
 
Upvote 0
I solved the problem. When hiding a User form, if you have a "User Form Activate" event subroutine, it executes every time the form reappears. So, I changed the code to have the User Form Activate event make the splash screen visible and the code now works perfectly.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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