Run userForm only when opened manually

;

;-\)

I have a excel sheet that I need to have a usrForm run but only when it is
opened by hand. I will be calling this XLS from a VB program and that
shouldn't run it.

What events should I use to trigger this?
 
R

Ron de Bruin

Use this sub in a normal module
Alt-F11
Insert>Module in the menubar
paste the sub there
Alt-Q to go back to Excel

Sub Auto_Open()
Userform1.show
End Sub

This will not run if you open the workbook with code
If you place the code in the workbook open event it will run when
you open the workbook with code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top