Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a userform w/ a listbox that has a few items. How do I test to be
sure at least one item is selected when OK is clicked. None of the following will display the MsgBox to find the omision of listbox selection: If Len(Listbox1) = 0 Then MsgBox "..." If IsEmpty(Listbox1) Then MsgBox "..." If Listbox1 = "" Then MsgBox "..." How do I tell if no selection has been made? I appreciate your help, -John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The ListIndex property of the ListBox will be -1 (minus one).
-- Rick (MVP - Excel) "John" wrote in message ... I have a userform w/ a listbox that has a few items. How do I test to be sure at least one item is selected when OK is clicked. None of the following will display the MsgBox to find the omision of listbox selection: If Len(Listbox1) = 0 Then MsgBox "..." If IsEmpty(Listbox1) Then MsgBox "..." If Listbox1 = "" Then MsgBox "..." How do I tell if no selection has been made? I appreciate your help, -John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Listbox no selection | Excel Programming | |||
Listbox Selection | Excel Programming | |||
Test for an empty selection | Excel Programming | |||
ListBox selection | Excel Programming | |||
test vba in listbox (UF) | Excel Programming |