How to activate Userform when I open the xl file containing a macro?

prshnthvn

New Member
Joined
Jan 23, 2010
Messages
30
Hello Everybody,

Can anyone let me know how to activate Userform when I open the excel file containing that macro?

I have created a Userform with 2 Command buttons. One button to Run the macro and other to close the file. I don't know how to bring the userform when I open the this Excel file. Every time I have to go to VB editor window and run the form from there.

Thanks & Regards,
Prashanth
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try this: in the VB editor double click ThisWorkbook and paste in

Code:
Private Sub Workbook_Open()
UserForm1.Show
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,132,670
Messages
5,654,653
Members
418,146
Latest member
Shnn028

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
Top