Stupid logic is messing up again... < = Statements crapping out...
Hello! I am having issues with the following code...It seems that my
statment below isn't working the way it should. Here is the
situation... THE < ans, ans, = ans is the problem. I need the code to
only match the TRUE completed value of TextBox3... I applogize how
disorganized this appears but there is no better way to present it.
COMPLETED CODE
Private Sub CommandButton1_Click()
On Error GoTo nogood
ans = TextBox3.Value
'================================vvvvvv======
If Sheet1.Range("datacorrect").Find(ans).Row < ans Then
'================================^^^^^^^======
MsgBox "OK"
Unload Me
Exit Sub
End If
nogood: MsgBox "Information Incorrect...Please try again."
Userform1.Show
End Sub
SITUATION 1 [ ans ] -- Partial Information Completes Macro
'================================vvvvvv======
If Sheet1.Range("datacorrect").Find(ans).Row < ans Then
'================================^^^^^^^======
Situation: If the person types the first few characters but not the
true value of the range it still completes the macro even though the
answer is wrong. The named range "datacorrect" only lists "booking" in
this instance but it will complete the macro if someone types "boo" in
Textbox1.
SITUATION 2 [ < ans ] -- Anything typed in fails
'================================vvvvvv======
If Sheet1.Range("datacorrect").Find(ans).Row ans Then
'================================^^^^^^^======
Situation: If the person types any thing in it wont complete the macro
and sends them straight to "NOGOOD: EVENT"
SITUATION 2 [ = ans ] -- Anything typed in fails
'================================vvvvvv======
If Sheet1.Range("datacorrect").Find(ans).Row = ans Then
'================================^^^^^^^======
Situation: If the person types any thing in it wont complete the macro
and sends them straight to "NOGOOD: EVENT"
|