User Form with CheckBoxes
You sure you're looking at the correct sheet?
And if you do have an event that fires when you make a change, maybe you want
something like:
Private Sub OKButton_Click()
If CheckBoxClearCS.Value = True Then
'why select
Application.EnableEvents = False
Worksheets("MMS for CS").Range("O3").ClearContents
Application.EnableEvents = true
Else
MsgBox "Not checked"
Worksheets("MMS for CS").select
Range("A1").Select
End If
CheckBoxClearCS.Value = 0
AskReClearData.Hide
End Sub
Paige wrote:
Can someone advise why this doesn't work; the userform (AskReClearData) shows
up okay, but when I check the 'CheckBoxClearCS' within the form (done in a
frame via the Control Toolbox) and then hit ok, the code essentially skips
the 5th line (re clear contents). If the checkbox is NOT selected and I hit
OK, then the code runs correctly.
Private Sub OKButton_Click()
Application.EnableEvents = True
If CheckBoxClearCS.Value = True Then
Worksheets("MMS for CS").Activate
Range("O3").ClearContents
Else
MsgBox ("Not checked")
Worksheets("MMS for CS").Activate
Range("A1").Select
End If
CheckBoxClearCS.Value = 0
AskReClearData.Hide
End Sub
--
Dave Peterson
|