+ Reply to Thread
Results 1 to 6 of 6

CommandButton Question

  1. #1
    Magnivy
    Guest

    CommandButton Question

    I inserted a CommandButton into a worksheet. I'm trying to have the
    CommandButton run another macro that I have in a different module (Module 4).
    The code that I've used is

    Private Sub CommandButton1_Click()
    Call Module4.MACRO1
    End Sub

    However, instead of executing the macro, it displays the VBE window for
    CommandButton1 (and shows the above code).

    How can I have the CommandButton run the macro instead of displaying the VBE?

    Thanks in advance for your help!

    Magnivy


  2. #2
    Die_Another_Day
    Guest

    Re: CommandButton Question

    You're making it too dificult. Try this:

    Call Macro1

    HTH

    Die_Another_Day

    Magnivy wrote:
    > I inserted a CommandButton into a worksheet. I'm trying to have the
    > CommandButton run another macro that I have in a different module (Module 4).
    > The code that I've used is
    >
    > Private Sub CommandButton1_Click()
    > Call Module4.MACRO1
    > End Sub
    >
    > However, instead of executing the macro, it displays the VBE window for
    > CommandButton1 (and shows the above code).
    >
    > How can I have the CommandButton run the macro instead of displaying the VBE?
    >
    > Thanks in advance for your help!
    >
    > Magnivy



  3. #3
    Magnivy
    Guest

    RE: CommandButton Question

    I tried another time and it worked. Please disregard the question below.

    Magnivy
    "Magnivy" wrote:

    > I inserted a CommandButton into a worksheet. I'm trying to have the
    > CommandButton run another macro that I have in a different module (Module 4).
    > The code that I've used is
    >
    > Private Sub CommandButton1_Click()
    > Call Module4.MACRO1
    > End Sub
    >
    > However, instead of executing the macro, it displays the VBE window for
    > CommandButton1 (and shows the above code).
    >
    > How can I have the CommandButton run the macro instead of displaying the VBE?
    >
    > Thanks in advance for your help!
    >
    > Magnivy
    >


  4. #4
    Jeff Standen
    Guest

    Re: CommandButton Question

    Sounds like you're still in design mode and you're double clicking - is that
    possible?

    Jeff

    "Magnivy" <[email protected]> wrote in message
    news:[email protected]...
    >I inserted a CommandButton into a worksheet. I'm trying to have the
    > CommandButton run another macro that I have in a different module (Module
    > 4).
    > The code that I've used is
    >
    > Private Sub CommandButton1_Click()
    > Call Module4.MACRO1
    > End Sub
    >
    > However, instead of executing the macro, it displays the VBE window for
    > CommandButton1 (and shows the above code).
    >
    > How can I have the CommandButton run the macro instead of displaying the
    > VBE?
    >
    > Thanks in advance for your help!
    >
    > Magnivy
    >




  5. #5
    Forum Contributor
    Join Date
    06-01-2006
    Posts
    324
    Make sure you are not in design mode.

    To check, goto View, Toolbars, Control Toolbox, is the Design Mode icon highlighted?

    When you mouse over the Commandbutton, do you see an arrow (normal mode)? or an arrow with direction arrows around it (design mode)?
    Google is your best friend!

  6. #6
    Magnivy
    Guest

    Re: CommandButton Question

    Yep, I was in design mode. Thanks a lot for your help Bearacade!

    "Bearacade" wrote:

    >
    > Make sure you are not in design mode.
    >
    > To check, goto View, Toolbars, Control Toolbox, is the Design Mode icon
    > highlighted?
    >
    > When you mouse over the Commandbutton, do you see an arrow (normal
    > mode)? or an arrow with direction arrows around it (design mode)?
    >
    >
    > --
    > Bearacade
    >
    >
    > ------------------------------------------------------------------------
    > Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
    > View this thread: http://www.excelforum.com/showthread...hreadid=549979
    >
    >


+ 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