Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Listbox no selection

How do I tell when no selection has been made when a user has clicked OK on
my UserForm that contains text and list boxes? I get the text box input and
the listbox selections fine, but none of the following tests identify when
the user fails to select anything in the list box.
If IsEmpty(InAIOwner) Then MsgBox "..."
If Len(InAIOwner) = 0Then MsgBox "..."
If InAIOwner = "" Then MsgBox "..."
How do I test for no selection?

I appreciate your help, -John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default Listbox no selection

Hi John

If nothing is selscted then the ListIndex property is less than zero. Zero
is the first item in the list.

HTH. Best wishes Harald

"John" wrote in message
...
How do I tell when no selection has been made when a user has clicked OK
on
my UserForm that contains text and list boxes? I get the text box input
and
the listbox selections fine, but none of the following tests identify when
the user fails to select anything in the list box.
If IsEmpty(InAIOwner) Then MsgBox "..."
If Len(InAIOwner) = 0Then MsgBox "..."
If InAIOwner = "" Then MsgBox "..."
How do I test for no selection?

I appreciate your help, -John


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox selection ub Excel Discussion (Misc queries) 0 March 10th 09 06:43 PM
Listbox selection Jonathan Excel Programming 4 July 27th 06 10:02 PM
Listbox Selection Help Matt[_38_] Excel Programming 1 March 9th 06 04:31 PM
Listbox Selection Todd Huttenstine Excel Programming 1 December 9th 04 08:37 PM
ListBox selection GMet Excel Programming 1 September 24th 04 08:02 PM


All times are GMT +1. The time now is 04:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"