Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Richard,
Sounds like the code is in the sheet "Update". When you have an Option Button it has an associated on-click event code in the sheet module. You can't get around that. What you can do is have the click event code run a macro in a standard module. Private Sub CommandButton1_Click() Run mymacro End Sub Or copy the code from behind the "Update" sheet and copy it to the module for the "All" sheet. -- sb "Richard" wrote in message ... Hello, I have a workbook called Allotment which contains two spreadsheets called All and Update. Update has two CommandButtons called OptionA and OptionB. In Update both buttons execute the code without a problem. I wish to be able to place both these buttons on sheet All and run then from there. This is what I have done. Opened control Toolbox in sheet Update and clicked on the OptionA button and selected copy. Then over to the All sheet and clicked paste. Gone back to Update and copied code over to the CommandButton in the All sheet. When I click the command button in the All sheet, the button is executing the code applicable to the Update sheet within the All sheet. The first lines of code for the Conmmand button delete cells in the Update sheet, which is how it should, but when run from the All sheet it is deleting basically all of my sheet All, just leaving some remnants of macro buttons etc. What am I doing wrong. How can I drive the Update sheet alone from the All sheet where I have copied the buttons and code to. In other words the commands are executing on the wrong sheet. Any help, please! Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
command button add another command | Excel Discussion (Misc queries) | |||
Command button | Excel Discussion (Misc queries) | |||
Command Button protection problems???? | Excel Worksheet Functions | |||
command button | Excel Discussion (Misc queries) | |||
Command Button vs Form Button | Excel Programming |