×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Excel VBA application start

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

RE: Excel VBA application start

Yes.Look to  HELP on Auto_Open procedure.
m777182

RE: Excel VBA application start

(OP)
When i look to HELP on Auto_open. There is nothing regarding it. Are you maybe thinking Im using the full VB programme ? I only have VBA which is included in Excel ?

RE: Excel VBA application start

(OP)
Im really looking to use something similar to the following :-

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

One of my programs starts this way:the UserForm_1 contains a sort of a message box with four CommandButtons. It opens automatically whenever I open the workbook that contains it and the code in UserForm_1 is:

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources