View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Multiselect listbox if no selection

If lst_Comp_Lv = Null Then

You didn't specified a property. A list box has several. What property of
the list box are you comparing to Null? The default propery is Value. So
what you're really asking is:

If lst_Comp_Lv.Value = Null Then

But what does the Value property of a list box represent? You've assumed it
represents whether any items are selected I guess but maybe it represents
the number of items in the listbox. Or its length or name or... So we
check Help.

Help says the Value proerty of a list box is "The value in the BoundColumn
of the currently selected rows."

That certainly has nothing to do with whether any items are selected. So
that's why it didn't help you.

--
Jim
"BigPig" wrote in message
...
| Hi Jim,
|
| Thank you that worked.
|
| Question:
|
| Why wouldn't this work?
|
| If lst_Comp_Lv = Null Then
| MsgBox "There is nothing selected."
| Exit Sub
| End If
|
| Thanks again.