+ Reply to Thread
Results 1 to 3 of 3

Placing action on a button!!

  1. #1
    Registered User
    Join Date
    11-14-2005
    Posts
    37

    Placing action on a button!!

    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 I press a button.
    I've created a command button from User Form, but I don't know how to place the action (when I press the button, the macro should be launched), and also, how to add this button in the Excel worksheet, because it's only designed in VBA.

    Thanks in advance,
    Chris

  2. #2
    Chip Pearson
    Guest

    Re: Placing action on a button!!

    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]...
    >
    > 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 I
    > press a button.
    > I've created a command button from User Form, but I don't know
    > how to
    > place the action (when I press the button, the macro should be
    > launched), and also, how to add this button in the Excel
    > worksheet,
    > because it's only designed in VBA.
    >
    > Thanks in advance,
    > Chris
    >
    >
    > --
    > loopoo
    > ------------------------------------------------------------------------
    > loopoo's Profile:
    > http://www.excelforum.com/member.php...o&userid=28792
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=486194
    >




  3. #3
    Registered User
    Join Date
    11-14-2005
    Posts
    37
    Thanks a lot for your help.

    Chris

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1