Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Toggling a Command Button
I'm trying to setup a command button toggles between two captions, and
performs a different routine depending on the caption when pushed. I found the routine below in the help, and this would appear to be perfect. However, when it attempts to execute the caption change, I get an "object required" error. Using Excel 2003 with Win XP. Any suggestions? Todd Private Sub CommandButton1_Click () If CommandButton1.Caption = "OK" Then 'Check caption, then change it. CommandButton1.Caption = "Clicked" CommandButton1.Accelerator = "C" 'Set Accelerator key to COMMAND + C Else CommandButton1.Caption = "OK" CommandButton1.Accelerator = "O" 'Set Accelerator key to COMMAND + O End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
command button add another command | Excel Discussion (Misc queries) | |||
Command Button | Excel Worksheet Functions | |||
Using a command button to add | Excel Discussion (Misc queries) | |||
Command Button vs Control Button | Excel Programming | |||
Command Button vs Form Button | Excel Programming |