Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I have a listbox that is multiselect. I want to find a way to figure out if anything is selected, if not "do something". I wrote this which works, but I have to think that there is an easier way. Dim Z As Integer Z = 0 With lst_Comp_Lv For i = 0 To .ListCount - 1 If .Selected(i) Then Else Z = Z + 1 End If Next i End With If Z = lst_Comp_Lv.ListCount Then MsgBox "There was nothing selected." Exit Sub End If I also tried: If lst_Comp_Lv = Null Then MsgBox "There is nothing selected." Exit Sub End If But that didn't work. Any suggestions or advice you could provide would be greatly appreciated. Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with multiselect listbox items selection | Excel Programming | |||
change combobox values one by one based on selection in multiselect listbox | Excel Programming | |||
Last Selection from MultiSelect Listbox | Excel Programming | |||
Multiselect Listbox | Excel Programming | |||
Multiselect listbox selection question | Excel Programming |