View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Listbox Value = Null ??

If lbxPreview.listindex < 0 then
'nothing selected

0 is the first item. N-1 is the Nth item.


Ryan H wrote:

I have a list box and a command button on a userform. When the command
button is clicked I want to test to ensure the user has selected only 1 item
in the listbox. I have this but it doesn't work and I don't know why, any
ideas?

' ensure a part number is selected to edit
If lbxPreview.Value = Null Then
MsgBox "Please select a Part Number from the list to edit.",
vbCritical
Exit Sub
End If

--
Cheers,
Ryan


--

Dave Peterson