Running multiple macros with one command button on userform

ExcelNovice

Well-known Member
Joined
May 12, 2002
Messages
583
Hi, I'm trying to run the following macros from a userform but continues to get an error each time I try:

Private Sub CommandButton1_click()
Call Worksheets("Sheet1").CommandButton11_click
Call Worksheets("Sheet1").CommandButton12_click
Call Worksheets("Sheet1").CommandButton13_click
Call Worksheets("Sheet1").CommandButton14_click

End Sub

The error received is:

Run-time error '438'
Object doesn't support this property or method

Thanks for your help.
 
Assuming all your scripts work OK when the buttons are pressed separately then I'm not sure what the problem might be.

You are using select a lot.

Try using a script like this:
You will see I did not use select and activate.

Code:
Private Sub CommandButton11_Click()
'Modified  9/22/2019  12:47:36 AM  EDT
    If Range("os56") = 0 Then
        Range("AA81:AA83").RowHeight = 0.000001
        Range("os56") = 4
    Else
        Range("AA81:AA82").RowHeight = 12.75
        Range("AA83:AA83").RowHeight = 13.5
        Range("os56") = 0
End If
End Sub
 
Last edited:
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You haven't removed the word Private from the procedure name. This
Code:
Private Sub CommandButton11_Click()
should be
Code:
Sub CommandButton11_Click()
 
Upvote 1

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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