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?
2 Answers
Try:
If Me.Checkbox1 = True Then
'whatever code goes here
End If
3 Comments
Karen Schaefer
this is Excel not access vba - I believe I need to pass the sheet name...
JNevill
Me is fine to use in Excel VBA, however, it's superfluous in this instance. If this code is in the worksheet's vba code, then it will work. If the code is in a module, then me would be referencing the module.JB28
Did you look at this forum at all? - mrexcel.com/forum/excel-questions/…

CheckBox1? How aboutSheet1.CheckBox? Is it an activeX checkbox, or a form control checkbox?