Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA skips on a check if Listbox.Value is Null ? 1

Status
Not open for further replies.

VBAguy22

IS-IT--Management
Aug 5, 2003
180
CA
Hi,
I am trying to build an If statement to catch the case where user forgets to select a listbox value. For some reason VBA skips it, keeps on going and crashes when the value is to be used. What am I doing wrong?


If (Sheets("Menu").ListBox1.Value Is Null) Then
MsgBox ("Please make a valid selection")
End
 
Perhaps something like this (typed, untested) ?
If Trim(ActiveWorkbook.Sheets("Menu").ListBox1.Value & "") = "" Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top