J
John Smith
Hi,
I have four checkboxes on a Userform, named "CheckBox1, etc." and that
need to be disabled if the corresponding value isn't available as a
choice in column 3 of the worksheet. If the number 4 isn't anywhere in
column 3 of the worksheet, then the checkbox (4) on the Userform needs
to be disabled. The code below generates a "Method or data member not
found" error. What do I need to fix to make the code work?
Thanks.
James
Sub Grade_Levels()
Dim NmArray As Variant
Dim Ctr As Integer
NmArray = Array(1, 2, 3, 4)
For Ctr = LBound(NmArray) To UBound(NmArray)
If Application.CountIf(Range("C4:C" & LastRow), NmArray(Ctr))
< 1 Then
UserForm3.CheckBox& NmArray(Ctr).Enabled = False ===> ERROR
MsgBox NmArray(Ctr)
End If
Next
End Sub
I have four checkboxes on a Userform, named "CheckBox1, etc." and that
need to be disabled if the corresponding value isn't available as a
choice in column 3 of the worksheet. If the number 4 isn't anywhere in
column 3 of the worksheet, then the checkbox (4) on the Userform needs
to be disabled. The code below generates a "Method or data member not
found" error. What do I need to fix to make the code work?
Thanks.
James
Sub Grade_Levels()
Dim NmArray As Variant
Dim Ctr As Integer
NmArray = Array(1, 2, 3, 4)
For Ctr = LBound(NmArray) To UBound(NmArray)
If Application.CountIf(Range("C4:C" & LastRow), NmArray(Ctr))
< 1 Then
UserForm3.CheckBox& NmArray(Ctr).Enabled = False ===> ERROR
MsgBox NmArray(Ctr)
End If
Next
End Sub