Thread: Apples or pears
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Apples or pears

If instr(1,Me.Textbox1.Text,"apples",vbTextcompare) 0 or _
instr(1,Me.Textbox1.Text,"pears",vbTextcompare) 0 then
Unload Me
Userform4.Show
End if

--
Regards,
Tom Ogilvy


"Leo Heuser" wrote in message
...
Hi

Try this one:

If Ucase(Me.TextBox1.Text) = "APPLES" Or _
Ucase(Me.TextBox1.Text) = "PEARS" Then
Unload Me
UserForm4.Show
End If

The use of Ucase() means, that the user can
enter any combination of upper- and/or lower case
in the text box.

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"gregork" skrev i en meddelelse
...
Hi could someone show me the correct way of writing this code:

If Me.TextBox1.Text = "Apples" or "pears" Then
Unload Me
UserForm4.Show
End If

thanks
GK