Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have several command buttons that I need to enable and disable depending on
the one that is clicked currently my code reads like this. CommandButton1 Click() CommandButton1.Enabled = False 'because it was clicked CommandButton2.Enabled = Ture 'because now it can be clicked CommandButton2.Enabled = Ture 'because now it can be clicked CommandButton2.Enabled = Ture 'because now it can be clicked This continues for every commandbutton click procedure. I would like to rewrite the code to go something like this but I cannot get it to work. Please Help Option Explicit Dim Choice CommandButtonChoice Sub() CommandButton1.Enabled = True CommandButton2.Enabled = True CommandButton3.Enabled = True CommandButton4.Enabled = True Choice.Enabled = False <=============This turns the choice off End Sub CommandButton1 Click() Choice=CommandButton1 <=============Choice to turn off Call CommandButtonChoice End Sub Repeat for each click procedure |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Command button | Excel Discussion (Misc queries) | |||
Command Button | Excel Discussion (Misc queries) | |||
VBA Command Button | Excel Discussion (Misc queries) | |||
command button | Excel Discussion (Misc queries) | |||
Command Button | Excel Discussion (Misc queries) |