PDA

View Full Version : Enabling and Disabling Buttons



ladeda16
03-16-2008, 10:32 PM
Hello All! I would like to disable a button after its clicked.
Like if i have contents in any cell, then suddenly if i made a button to clear it, then after pressing the button to clear it, how can i disable the button so that the contents can't be cleared.

Here is what i have so far.


Private Sub cmdClear_Click()

Range("A21:C21").ClearContents
Range("B23:B25").ClearContents

cmdClear.Enabled = False
cmdClear.Enabled = True

End Sub

Bob Phillips
03-17-2008, 01:40 AM
Just remove the second Enable statement, the one that sets it to True