Excel VBA error in filling and not filling a list
I want to populate the list box when the check mark is ticked and empty when the check mark is removed.
This code worked for this function in my previous modules, but now I am getting an error (I assume these are arguments for Range) and I would like to understand why. In addition, the list box remains the same as when unchecked.
Here is my code:
Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
ListBox1.List = Sheets("DATA").Range("C22").Value
Else
ListBox1.ListFillRange = ""
End If
End Sub
+3
source to share
2 answers