One Button To Execute Two Macros [Solved/Closed]

azmiismail 17 Posts Thursday March 3, 2011Registration date July 20, 2011 Last seen - Mar 3, 2011 at 01:16 AM - Latest reply: azmiismail 17 Posts Thursday March 3, 2011Registration date July 20, 2011 Last seen
- Mar 3, 2011 at 11:06 PM
Hello,
I got one macro in Sheet1 and another macro in sheet2 under the same workbook.I want to assign a button in sheet1 so it can execute both the macros in sheet1 and sheet2.Can someone help me....please

Thanks
See more 

4 replies

Best answer
venkat1926 1865 Posts Sunday June 14, 2009Registration dateContributorStatus July 30, 2015 Last seen - Mar 3, 2011 at 04:34 AM
6
Thank you
are they macros or event codes depending upon the sheet name. are they macros in the same workbooks create anothermacro

sub fullmacsro
(name of first macro)
(name of second macro)
end usb

make a button and assign "fullmacro" to this button.

Thank you, venkat1926 6

Something to say? Add comment

CCM has helped 1692 users this month

azmiismail 17 Posts Thursday March 3, 2011Registration date July 20, 2011 Last seen - Mar 3, 2011 at 06:14 PM
0
Thank you
Got an error message.To be more specific below are the details,

Under the workbook named "TESTCOMBUTTON"

In Sheet1,the code is,
Sub ClrClls()
Range("B2:B4").ClearContents
End Sub

In Sheet2,the code is,
Sub ClrChks()
ActiveSheet.CheckBoxes.Value=False
End Sub

I would like to assign a button in sheet1 to execute both the code.

Thanks.
venkat1926 1865 Posts Sunday June 14, 2009Registration dateContributorStatus July 30, 2015 Last seen - Mar 3, 2011 at 08:12 PM
0
Thank you
there is no macro in one sheet and another macro in another sheet. the macros are in one module in vb editor


anyhow try this modification


Sub ClrClls()  
worksheets("sheet1").activate  
Range("B2:B4").ClearContents  
End Sub  


Sub ClrChks()  
worksheets("sheet2").activate  
ActiveSheet.CheckBoxes.Value=False  
End Sub 



whenever you talk about error message you musts tell at which statement the error message occurs(or the macro stops) and also the text of error message which will be helpful to try to solve the problem.
azmiismail 17 Posts Thursday March 3, 2011Registration date July 20, 2011 Last seen - Mar 3, 2011 at 11:06 PM
0
Thank you
Solved,Thank you very much.