Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
row by row comparison using a "countif" and "and" condition? controlfreak Excel Programming 2 May 16th 08 02:10 PM
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running [email protected] Excel Programming 5 May 16th 07 08:18 PM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM


All times are GMT +1. The time now is 08:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"