Events on controls created run time

H

harodrigues

I've this small excel vba program which asks information to the user
and then creates another form with labels and commandbuttons. How can
I determine if the commandbutton was clicked?
 
J

John

Harold,
You have asked a question relating to VBA and Excel but this is a
newsgroup for VBA and Project. Perhaps you simply picked the wrong
newsgroup in error or perhaps, as I found out recently, the Excel VBA
group has about 100 messages per hour and answers are few and far
between. Whatever. The answer to your question is probably equally
applicable whether the commandbutton is in Project or Excel so I'll give
it a shot.

I recently wrote a macro that had a complex userform with command
buttons and other elements. To simply start an action when a command
button is clicked you probably want to use the Click Event. Look up the
syntax in the help file but it is basically:
Private Sub object_Click()

Hope this helps
John
 

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