I have a userform and on this userform I have a checkbox CheckNoncl1
. Here's the test code I made for click
event of this checkbox and it works fine:
Private Sub CheckNoncl1_Click()
If CheckNoncl1.Value = True Then
MsgBox "true"
Else
MsgBox "false"
End If
End Sub
But what if I want to make a dynamic reference and use Me
I get the "Method or data member not found". I suspect it is because "Me" in this case refers to the userform, not the checkbox.:
Private Sub CheckNoncl1_Click()
If Me.Value = True Then 'Error!
MsgBox "true"
Else
MsgBox "false"
End If
End Sub
How do I avoid this problem? Is there something I get completely wrong about event handlers for checkboxes?