Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apples or pears
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apples or pears
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apples or pears
Thanks for the reply. Can't get it to work though. Not sure why?
cheers GK "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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apples or pears
Works perfectly thanks Tom
Regards GK "Tom Ogilvy" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
can I nest COUNTIF functions(C5:C8,"apples") AND (D5:D8,"green") | Excel Worksheet Functions | |||
Who buys the apples | Excel Discussion (Misc queries) |