Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro Using "Like" comparison
I have found it convenient to use a macro code such as - If Cells(x, 3) Like
SS = True Then Check = "True"- where SS is - SS = Range("E12") & "*". I find that this comparison is case sensitive, which is inconvenient for my purposes. Is there a way of making this process insensitive to case with this macro code or some other code? Jim Walsh |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro Using "Like" comparison
Make the comparison in the same case like this:
If LCase(Cells(x, 3).Value) Like "ss = true" Then Check = "True" - where SS is - SS = Range("E12") & "*" "jswalsh33" wrote: I have found it convenient to use a macro code such as - If Cells(x, 3) Like SS = True Then Check = "True"- where SS is - SS = Range("E12") & "*". I find that this comparison is case sensitive, which is inconvenient for my purposes. Is there a way of making this process insensitive to case with this macro code or some other code? Jim Walsh |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro Using "Like" comparison
"jswalsh33" wrote: I have found it convenient to use a macro code such as - If Cells(x, 3) Like SS = True Then Check = "True"- where SS is - SS = Range("E12") & "*". I find that this comparison is case sensitive, which is inconvenient for my purposes. Is there a way of making this process insensitive to case with this macro code or some other code? Jim Walsh |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro Using "Like" comparison
Disregard the last one, I hit post in error.
"JLGWhiz" wrote in message ... Make the comparison in the same case like this: If LCase(Cells(x, 3).Value) Like "ss = true" Then Check = "True" - where SS is - SS = Range("E12") & "*" "jswalsh33" wrote: I have found it convenient to use a macro code such as - If Cells(x, 3) Like SS = True Then Check = "True"- where SS is - SS = Range("E12") & "*". I find that this comparison is case sensitive, which is inconvenient for my purposes. Is there a way of making this process insensitive to case with this macro code or some other code? Jim Walsh |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro Using "Like" comparison
You can also use the "Option Compare" statement at the top of the module
to force a case-insensitive comparison: Option Compare Text -- Jim Cone Portland, Oregon USA "jswalsh33" wrote in message I have found it convenient to use a macro code such as - If Cells(x, 3) Like SS = True Then Check = "True"- where SS is - SS = Range("E12") & "*". I find that this comparison is case sensitive, which is inconvenient for my purposes. Is there a way of making this process insensitive to case with this macro code or some other code? Jim Walsh |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro Using "Like" comparison
I don't follow your example, but in general I like converting to upper case
for case insensitive comparison. If UCase(s1) Like UCase(s2) Then... -- Tim Zych http://www.higherdata.com Workbook Compare - Excel data comparison utility Free and Pro versions "jswalsh33" wrote in message ... I have found it convenient to use a macro code such as - If Cells(x, 3) Like SS = True Then Check = "True"- where SS is - SS = Range("E12") & "*". I find that this comparison is case sensitive, which is inconvenient for my purposes. Is there a way of making this process insensitive to case with this macro code or some other code? Jim Walsh |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text "comparison" operator for "contains" used in an "IF" Function | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
row by row comparison using a "countif" and "and" condition? | Excel Programming | |||
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running | Excel Programming | |||
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" | Excel Discussion (Misc queries) |