How to automatically open another user form and close previous user form?

Dave Smith

New Member
Joined
Jul 5, 2021
Messages
32
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have created one excel having two user form out of two userform one is used as " WELCOME TO ATAS SHOP" as shown in below image and this userform will automatically open once the excel is opened I have written code to close it after 20 seconds now I want to open next userform where the user will select different products to check quantities in store room.

Can any body help me how to open another userform automatically after closing of the 1st userform (" WELCOME TO ATAS SHOP") it will be great help

Regards,
VBA Code:
this code is used to automatically open 1st userform after opening excel

Private Sub Workbook_Open()
UserForm1.Show
End Sub

this below code is used to automatically close 1st userform after 20 seconds


Private Sub UserForm_Activate()
Application.Wait (Now + TimeValue("0:00:20"))
Unload Me
End Sub
 

Attachments

  • Capture.JPG
    Capture.JPG
    87.3 KB · Views: 27
  • Capture_1.JPG
    Capture_1.JPG
    141 KB · Views: 26
  • Capture_2.JPG
    Capture_2.JPG
    26.4 KB · Views: 23
  • Capture_3.JPG
    Capture_3.JPG
    14.5 KB · Views: 27

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
VBA Code:
Private Sub UserForm_Activate()
Application.Wait (Now + TimeValue("0:00:20"))
Unload Me
UserForm2.Show
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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