displaying a userform after a sheet is selected

forest1959

New Member
Joined
Mar 16, 2010
Messages
30
Office Version
  1. 2016
Platform
  1. Windows
Hi

I'm trying to write some code that will firstly, open a specific worksheet, then display a userform.. Anything i have tried so far displays the user form before opening the worksheet.

the code i am using is below.

Is there something simple i'm missing that would delay the displaying of the userform until the user had visibility of the "Technique" worksheet.

Many Thanks

Code:
Sub SaveWithVariableFromCell()


    Application.ScreenUpdating = False
    
    Sheets("Technique").Visible = True
    Sheets("Calculator").Visible = False
    Sheets("Schedule").Visible = False
    Sheets("User Guide").Visible = False
    Sheets("Home").Visible = False
    Sheets("Technique").Select
    
    UserForm2.Show


    Application.ScreenUpdating = True    
    
End Sub
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Try turning ScreenUpdating back on, before showing the userform
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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