[VBA] Userform to show upon opening excel sheet, then use a password to log in.

LittleJon

New Member
Joined
Oct 14, 2018
Messages
18
Please could someone give me the code for opening up a userform upon opening an excel sheet. Userform is called MainUF1. Then i need to put in a username and password.

Any help would be appreciated.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I'm not sure what you mean by:
the userform would close.
Perhaps it would be best if you could explain in detail, step by step, what you want to happen when you open the workbook.
 
Upvote 0
When i open the workbook a userform would pop up. When i enter a username and password into that userform, it would close and allow me to use the workbook.
 
Upvote 0
If the name of the userform is MainUF1, then it should show on opening the workbook. Did you place the macro in the code module for ThisWorkbook as I described in Post #4 ? What are the names of the text boxes on the userform that will contain the username and password?
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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