View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jjordan jjordan is offline
external usenet poster
 
Posts: 16
Default ListBox data validation

Hi there,

I have a userform with a listbox. I need to verify that the user has
selected an item from this listbox, and if not have a message appear to tell
them to do so.

I've written the following code:

'check for a Month/Year
If Me.ListBox2.Value = "" Then
msg = "Please enter Valid Date"
MsgBox msg
UserForm1.ListBox2.SetFocus
Exit Sub
End If

This code will work on a Textbox, but not a listbox. Any help would be
greatly appreciated!

JJ