Thread: VBA ListBox
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default VBA ListBox

If no item has been selected in the listbox, the ListIndex
property will be -1. E.g.,

If Me.ListBox1.ListIndex = -1 Then
MsgBox "You must select an item"
End If



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"TAM" wrote in message
t...
Can anyone please tell me how to check that the user has made a

selection in
a VBA ListBox - I need to warn them if no selection has been

made

Thanks

TAM