Hi,
I have created a form in excel.But i want the form to automatically pop-up once the file is opened.Is it possible.
Form PopUp
-
-
-
Re: Form PopUp
Just put the code to display the form in the workbook open event.
To access the Open event of a workbook:1. Right click the small Excel icon next to File on the main toolbar and select View Code.
2. Select Workbook from the left dropdown.
3. You should now see the following code:
This is where you put any code to be run when the workbook opens. -
Re: Form PopUp
Sure can. You just need an event macro.
I assume you have a macro that shows the userform.
You need to trigger the macro that shows your form when you open the file.
In VBA Editor, double-click on ThisWorkbook. Select Object = Workbook (upper-left dropbox). The VBA editor inserts an event macro. If it's not the Private Sub Workbook_Open macro, delete that macro. Now select Procedure = Open (upper-right dropbox).
In the Private Sub Workbook_Open macro insert a line:
Application.Run "your_macro
That should do it for you.
Norie beat me to it. You can put the code to show the userform directly in the Private Sub Workbook_Open macro. If you want to display the same userform at other times while the workbook is open, you may want to create a separate macro to show the userform, depending on whether you have other coding that is not included in the userform code.
-
Re: Form PopUp
Thanks a lot norie.I will do that.
thanks for ur time.
-
Re: Form PopUp
Norie its not working.
Sorry to bother you.
Can you help me out.
I have attached the file.
-
Re: Form PopUp
Syntax error. Enclose the macro name in double-quotations:
"Login"
-
-
-
Re: Form PopUp
Thanks a lot norie.
-
Re: Form PopUp
Thanks a lot Brister.
It works.
Great!!
-
Re: Form PopUp
Thanks a lot Barbarr.
U guys are so kind.
-
-
Re: Form PopUp
Sorry Norie i didn't understand that at that time.
Its working fine Now.
What i did was i didn't use ".
Thanks for ur help and concern.
Sorry if i have bothered u too much.
Thanks a lot once again.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!