Command button to call other buttons help

Luis_B

New Member
Joined
Oct 13, 2021
Messages
38
Office Version
  1. 365
Platform
  1. Windows
Hi Guys,

I created three command buttons, one in a different tab. Each button works finds individually. I create another button in a separate tab that is not in any of the first three tabs. The last button is to call the other three buttons. I have done this before with other spreadsheets but with this VBA, I get an error when the button tries to call the second CommandButton. Also, the last button that I'm using to call all the first three buttons works if I only call one button at the time but I get an error if I try to call multiple buttons at once

Any help would be greatly appreciated.

Thank you,

Sub CommandButtonAll_Click()

Call Sheets("Worksite").CommandButton1_Click
Call Sheets("Worksite 3").CommandButton2_Click
Call Sheets("Worksite 4").CommandButton3_Click

End Sub
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hello!

Does your last button code in a Sheet code? If yes, try to move it into a Module.
 
Upvote 0
Hello!

Does your last button code in a Sheet code? If yes, try to move it into a Module.
Although, unfortunately, i can't repro your problem. The only offer that i give - check your buttons names.
 
Upvote 0
Although, unfortunately, i can't repro your problem. The only offer that i give - check your buttons names.
Thank you LazyBug. I had an error in my code related to the name of a sheet. It is working now
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,851
Members
449,051
Latest member
excelquestion515

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