I have a ListBox1
q list of a ChckBox1
checkbox in a UserForm. I want to enable or disable the checkbox ( CheckBox1.Enabled = True/False
if any items in the list are selected.
The checkbox is disabled initially, but if something is selected, I want it to be enabled for dialing.
At the moment I am using a validation loop, but I would like to know if there is a more direct way, without having to analyze item by item.
Private Sub ListBox1_Change()
Dim s As Boolean: s = False
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
s = True
Exit For
End If
Next i
CheckBox1.Enabled = s
End Sub