Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is my issue:
For example, txt is coming from a cell in a worksheet entered by the user. Function Test(txt as string) as string If (txt = "comm. lse" Or txt = "ME") Then Do this Else Do that End If End Function If the user enters Comm Lse, the statement will Do that instead of Do this. Any suggestions? (drop downs are not welcomed by the users...yet!) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ed
if you want a case insesitive function you can do something along the following lines Function Test(txt As String) As String If (LCase(txt) = "comm. lse" Or UCase(txt) = "ME") Then Do this Else Do that End If End Function Cheers JulieD "ed" wrote in message ... Here is my issue: For example, 'txt' is coming from a cell in a worksheet entered by the user. Function Test(txt as string) as string If (txt = "comm. lse" Or txt = "ME") Then Do this Else Do that End If End Function If the user enters Comm Lse, the statement will "Do that" instead of "Do this". Any suggestions? (drop downs are not welcomed by the users...yet!) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you're just worried about case:
Public Function Test(txt As String) As String If (LCase(txt) = "comm. lse" Or UCase(txt) = "ME") Then 'Do this Else 'Do that End If End Function note that this will not catch the lack of a "." in your example. In article , "ed" wrote: Here is my issue: For example, txt is coming from a cell in a worksheet entered by the user. Function Test(txt as string) as string If (txt = "comm. lse" Or txt = "ME") Then Do this Else Do that End If End Function If the user enters Comm Lse, the statement will Do that instead of Do this. Any suggestions? (drop downs are not welcomed by the users...yet!) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
countif function: how to distinguish case/make case sensitive | Excel Worksheet Functions | |||
Case sensitive filter | Excel Worksheet Functions | |||
Case sensitive filtering | Excel Discussion (Misc queries) | |||
Getting a case sensitive match? | Excel Worksheet Functions | |||
Case Sensitive w/ IF | Excel Worksheet Functions |