Excel VBA application start
Excel VBA application start
(OP)
I have written a VBA application for Excel, which involves the user filling in a form.
Is there a simple way to have this form load up automatically when the workbook is opened ?
At the moment Im thinking of using a button with a macro attached to it, but would obviously prefer if the form came up straight away.
Regards
Stephen
Is there a simple way to have this form load up automatically when the workbook is opened ?
At the moment Im thinking of using a button with a macro attached to it, but would obviously prefer if the form came up straight away.
Regards
Stephen





RE: Excel VBA application start
m777182
RE: Excel VBA application start
RE: Excel VBA application start
Private Sub Worksheet_Activate()
Load UserForm1
UserForm1.Show
End Sub
However, when Excel loads up, with this worksheet open, the userform doesnt activate, until you go away from this worksheet, and then go back into it. Is there anyway I can force the userform to be loading on the initial startup of the workbook.
Actually, just thiniking about it, as I typed this I tried the following and it works !!! :-
Private Sub Workbook_Open()
Load UserForm1
UserForm1.Show
End Sub
Just shows you, sometimes just thinking about it on a forum, helps you. ;o)
RE: Excel VBA application start
Sub auto_open()
End Sub
A click on CommandButton1 calls a sub to enter new data into a UserForm_2's TextBoxes:
Private Sub Commandbutton1_Click()
Rem new data entry
UserForm2.Show
…..
Rem Block of codes
…..
UserForm2.Hide
End Sub
A click on CommandButton2 calls a sub to correct data on a spredsheet:
Private Sub Commandbutton2_Click()
Rem correct entries
MsgBox "correction"
…
block of codes for correcting entries on a spreadsheet
…..
End Sub
A click on CommandButton3 alows viewing data on a spredsheet:
Private Sub Commandbutton3_Click()
Rem view data
MsgBox "view"
…
block of codes for viewing data on a spreadsheet
…..
End Sub
And a click on CommandButton4 calls a sub to exit activities Private Sub Commandbutton4_Click()
MsgBox "exit"
…
block of codes to exit
…..
End Sub
I am sure that more experienced programmer would do it better, but it works.
M777182