ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loading UserForm on start up. (https://www.excelbanter.com/excel-programming/326600-loading-userform-start-up.html)

Kobus

Loading UserForm on start up.
 
Using VBA in Excel, how do I display the first UserForm immediate when the
workbook has opened. The UserForm prompts the user for a date and then
recalculates all the values in the worksheet according to the date.

Xcelion

Loading UserForm on start up.
 
Hi Kobus,

You can wite the code in the Open event of workbook to show the form

Private Sub Workbook_Open()
Userform1.Show
End Sub

Thanks
Xcelion


"Kobus" wrote:

Using VBA in Excel, how do I display the first UserForm immediate when the
workbook has opened. The UserForm prompts the user for a date and then
recalculates all the values in the worksheet according to the date.


Paul

Loading UserForm on start up.
 
Hi Kobus,

on the thisworkbook module in VBA Editor paste:

Private Sub Workbook_Open()
UserForm.Show
End Sub

where, UserForm is the name of your user form.

to unload the userform:
Unload UserForm

hope this helps!!

"Kobus" wrote in message
...
Using VBA in Excel, how do I display the first UserForm immediate when the
workbook has opened. The UserForm prompts the user for a date and then
recalculates all the values in the worksheet according to the date.





All times are GMT +1. The time now is 03:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com