Placing action on a button!!

L

loopoo

Hello!

I'm new to VBA and I need some help for a basic thing:

I developed a macro, "export_data", and I want to launch it when
press a button.
I've created a command button from User Form, but I don't know how t
place the action (when I press the button, the macro should b
launched), and also, how to add this button in the Excel worksheet
because it's only designed in VBA.

Thanks in advance,
Chri
 
C

Chip Pearson

If you double-click on the button while you're in design mode in
the VBA Editor, you'll be taken to the _Click event of the
button. Paste the code there.

You can add a button directly on the worksheet by opening the
Forms command bar, and dragging a button onto the sheet. Right
click the button and choose Assign Macro. Assign your macro to
the button.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"loopoo" <[email protected]>
wrote in message
news:[email protected]...
 

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