I would like to know how to, for example, set:
X=1 when an item is 'checked' in a listbox
X=0 when an item is 'unchecked' in a listbox
Your help is appreciated. Thank you.
Printable View
I would like to know how to, for example, set:
X=1 when an item is 'checked' in a listbox
X=0 when an item is 'unchecked' in a listbox
Your help is appreciated. Thank you.
To know if it's Unchecked:
<code>
If List1.ListIndex <> -1 Then
List1.Selected(List1.ListIndex) = True
End If
</code>
To know if it's Checked:
<code>
If lstItems.ListIndex <> -1 Then
lstItems.Selected(lstItems.ListIndex) = False
End If
</code>
Hope this helps!
Yes, your code was very helpful.
Thank Asaf_99.