Thread: userform help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default userform help

Do a little truth table:

Entry <"M" <"N" <"M" Or <"N"

M FALSE TRUE TRUE
N TRUE FALSE TRUE
A TRUE TRUE TRUE

I suspect your want "And" instead of "Or"

Entry <"M" <"N" <"M" And <"N"

M FALSE TRUE FALSE
N TRUE FALSE FALSE
A TRUE TRUE TRUE



In article ,
"Gary Keramidas" <GKeramidasATmsn.com wrote:

can someone tell me why i get the message box no matter what i type in? if i
only use 1 condition, it works, as soon as i add the second, nothing works.

If UCase(Trim(Me.LSite.Value)) < "M" Or _
UCase(Trim(Me.LSite.Value)) < "N" Then
Me.LSite.SetFocus
MsgBox "Please Check Site"
Exit Sub
End If