+ Reply to Thread
Results 1 to 4 of 4

Command buttons & macros

  1. #1
    Jock W
    Guest

    Command buttons & macros

    How do I allocate a macro to a command button?
    Right clicking a command button which is in design mode brings down a drop
    down menu but 'assign macro' isn't on option.
    --
    Jock Waddington

  2. #2
    Bob Phillips
    Guest

    Re: Command buttons & macros

    Jock,

    Sounds like you have control toolbox button.. Assuming so, when in design
    mode, double-click the button, and then will open up the worksheet code
    module, and create a skeleton click event which would be where you add your
    code.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Jock W" <[email protected]> wrote in message
    news:[email protected]...
    > How do I allocate a macro to a command button?
    > Right clicking a command button which is in design mode brings down a drop
    > down menu but 'assign macro' isn't on option.
    > --
    > Jock Waddington




  3. #3
    Earl Kiosterud
    Guest

    Re: Command buttons & macros

    Jock,

    Command buttons have their own event handlers. Double-clicking one will
    take you to it, something like:

    Private Sub CommandButton1_Click()
    ' you could call your macro in here
    ' or just put the code here
    End Sub

    This event handler lives in the sheet module, like worksheet_change and
    other events.
    --
    Earl Kiosterud
    mvpearl omitthisword at verizon period net
    -------------------------------------------

    "Jock W" <[email protected]> wrote in message
    news:[email protected]...
    > How do I allocate a macro to a command button?
    > Right clicking a command button which is in design mode brings down a drop
    > down menu but 'assign macro' isn't on option.
    > --
    > Jock Waddington




  4. #4
    Jock W
    Guest

    Re: Command buttons & macros

    Thanks to Bob and Earl. Job done

    "Earl Kiosterud" wrote:

    > Jock,
    >
    > Command buttons have their own event handlers. Double-clicking one will
    > take you to it, something like:
    >
    > Private Sub CommandButton1_Click()
    > ' you could call your macro in here
    > ' or just put the code here
    > End Sub
    >
    > This event handler lives in the sheet module, like worksheet_change and
    > other events.
    > --
    > Earl Kiosterud
    > mvpearl omitthisword at verizon period net
    > -------------------------------------------
    >
    > "Jock W" <[email protected]> wrote in message
    > news:[email protected]...
    > > How do I allocate a macro to a command button?
    > > Right clicking a command button which is in design mode brings down a drop
    > > down menu but 'assign macro' isn't on option.
    > > --
    > > Jock Waddington

    >
    >
    >


+ 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