+ Reply to Thread
Results 1 to 5 of 5

Macro to Click Button?

Hybrid View

  1. #1
    Chronichalt@gmail.com
    Guest

    Macro to Click Button?

    I can't figure out how to reference macro subs to macro subs (If
    Possible???). I want to write a macro to an object that if selected,
    also runs the attached macro to a seperate object. My goal in this is
    to limit the amount of code in my spreadsheet by referencing code
    already written. I may be going about this all wrong, please give me
    some sugestions.

    What I need is a macro that will click button A if I click button B...


  2. #2
    Die_Another_Day
    Guest

    Re: Macro to Click Button?

    Like...
    Sub MacroA()
    'Your Code
    Call MacroB
    End Sub
    ?

    HTH

    Die_Another_Day
    Chronichalt@gmail.com wrote:
    > I can't figure out how to reference macro subs to macro subs (If
    > Possible???). I want to write a macro to an object that if selected,
    > also runs the attached macro to a seperate object. My goal in this is
    > to limit the amount of code in my spreadsheet by referencing code
    > already written. I may be going about this all wrong, please give me
    > some sugestions.
    >
    > What I need is a macro that will click button A if I click button B...



  3. #3
    Chronichalt@gmail.com
    Guest

    Re: Macro to Click Button?

    Tight! Perfect.


    Die_Another_Day wrote:
    > Like...
    > Sub MacroA()
    > 'Your Code
    > Call MacroB
    > End Sub
    > ?
    >
    > HTH
    >
    > Die_Another_Day
    > Chronichalt@gmail.com wrote:
    > > I can't figure out how to reference macro subs to macro subs (If
    > > Possible???). I want to write a macro to an object that if selected,
    > > also runs the attached macro to a seperate object. My goal in this is
    > > to limit the amount of code in my spreadsheet by referencing code
    > > already written. I may be going about this all wrong, please give me
    > > some sugestions.
    > >
    > > What I need is a macro that will click button A if I click button B...



  4. #4
    Ingolf
    Guest

    Re: Macro to Click Button?

    Hi,

    provided you have a UserForm1 with ButtonA and ButtonB on it. Now you
    want to trigger the click-event of ButtonB when actually clicking on
    ButtonA. Try the following

    Private Sub ButtonA_Click()
    'Your code for this event
    UserForm1.ButtonB.Value = True
    End Sub

    Regards,
    Ingolf

    Chronichalt@gmail.com schrieb:

    > I can't figure out how to reference macro subs to macro subs (If
    > Possible???). I want to write a macro to an object that if selected,
    > also runs the attached macro to a seperate object. My goal in this is
    > to limit the amount of code in my spreadsheet by referencing code
    > already written. I may be going about this all wrong, please give me
    > some sugestions.
    >
    > What I need is a macro that will click button A if I click button B...



  5. #5
    Ardus Petus
    Guest

    Re: Macro to Click Button?

    Private Sub ButtonA_Click()
    'Your code for this event
    ButtonB_Click
    End Sub

    HTH
    --
    AP


    <Chronichalt@gmail.com> a écrit dans le message de news:
    1152912710.811649.274680@m73g2000cwd.googlegroups.com...
    >I can't figure out how to reference macro subs to macro subs (If
    > Possible???). I want to write a macro to an object that if selected,
    > also runs the attached macro to a seperate object. My goal in this is
    > to limit the amount of code in my spreadsheet by referencing code
    > already written. I may be going about this all wrong, please give me
    > some sugestions.
    >
    > What I need is a macro that will click button A if I click button B...
    >




+ 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