Push one form control to click 5 other buttons

jackson1990

Board Regular
Joined
Feb 21, 2017
Messages
56
So, I have 5 or so buttons I want clicked all at once. They are all the same macro, but based on the location of the button they pull different data. They are all form control buttons, so I was wondering how I would go about making a button that would click all 5? I thought maybe the call function but that only seems to work with Macro's, and since the macro depends on placement in the excel that doesn't work. Is there a way to click all 5 form control buttons via VBA?

For this example, say the form buttons are Button 24, Button 27, Button 28, Button 29, Button 30

Thanks in advance everyone!
 
Re: Changing code for a control form to activex

I get what you are saying, but as a question since we've gone this far, is there a way to automate this? The range part. The only way I see if working right now is if I enter the cell in which the button is located, which is fine I could go into each sheet and manually enter these (Example: AddAry = Array("F10", "F15", "'F20") ect). Are you saying I could just put in F10-F30 and it would fine which ones the buttons were in? Just trying to make sure I understand again.
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Re: Changing code for a control form to activex

No, you will need to specify the exact cell including sheet name, as I showed.
 
Upvote 0
Re: Changing code for a control form to activex

your welcome.
As this thread & your other one are now overlapping I will merge them.
 
Upvote 0
Re: Changing code for a control form to activex

One last question. Is there a way I can get,
Code:
Sub EmailALLCT()Dim AddAry As Variant
   Dim RngAdd As Variant
   AddAry = Array("F1")
   For Each RngAdd In AddAry
      Call EmailAll(Range(RngAdd))
   Next RngAdd
End Sub

to go through F1-F35?
Code:
   AddAry = Array("F1")

So instead of having to punch in F1, F2, F3, F4, F5...ect. I tried doing just straight "F1:F35", but that does not produce any action. Can I change this to a range?
 
Upvote 0
Re: Changing code for a control form to activex

Are they all on the Activesheet?
 
Upvote 0
Re: Changing code for a control form to activex

In that case you'll need to do it like
Code:
AddAry = Array("F1", "F2", "F3")
 
Upvote 0
Re: Changing code for a control form to activex

You're welcome
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top