Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook with two sheets. There is a button on each sheet
with code to erase a named range without deleting areas that aren't included in the range. If I press a button, the code executes OK. Then when I go to the other sheet I can't press the second button. Also, sometimes I can't select it in design mode. Actually, I can select the button but when I right-click it and select "Properties", it gives me the sheet properties instead of the button properties. What am I doing wrong? Here is the button code: Sub CommandButton1_Click() 'Erase data in Overtime Report sheet vAnswer = msgbox("This will erase all your data but not the formulas. Continue?", vbYesNo) If vAnswer = vbYes Then Application.Goto Reference:="OTDataEntry" Selection.ClearContents End If Range("A1").Select Range("E7").Select End Sub ------------------------------------------ Sub CommandButton2_Click() 'Erase data in HOURS sheet vAnswer = msgbox("This will erase all your data but not the formulas. Continue?", vbYesNo) If vAnswer = vbYes Then Application.Goto Reference:="DataEntry" Selection.ClearContents End If Range("A1").Select Range("G3").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
preventing button being pressed | Excel Discussion (Misc queries) | |||
TRAPPING PRESSED BUTTON | Excel Programming | |||
Message box display or something in the status area after macro button is pressed? | Excel Programming | |||
Which button was pressed? | Excel Programming | |||
Errormessage when button is pressed twice or more | Excel Programming |