Reputation: 107
I need to verify if an activex checkbox is checked in my vba code, however, when I try - " If Checkbox1.Value = True Then" it is asking for variable not defined. What am i missing?
Upvotes: 1
Views: 1987
Reputation: 96753
How about:
Sub dural()
If ActiveSheet.OLEObjects("CheckBox1").Object.Value = True Then
MsgBox "it is checked"
End If
End Sub
Note this is for a "standalone" ActiveX checkbox (not on a userform)
Upvotes: 2