Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following:
If current = temp then End if My problem is the following: Current = Apple temp = APPLE How can I compare these two strings without the case involved. I want the if statement to treat them as equal. Thank, Eric Sabo |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Eric,
Try: If LCase(current) = LCase(temp) then --- Regards, Norman "Sabo, Eric" wrote in message ... I have the following: If current = temp then End if My problem is the following: Current = Apple temp = APPLE How can I compare these two strings without the case involved. I want the if statement to treat them as equal. Thank, Eric Sabo |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Eric I think this should work
If StrComp(temp, Current, vbTextCompare) = 0 Then 'Your Code in here End If regards, Tim |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Eric I think this should work
If StrComp(temp, Current, vbTextCompare) = 0 Then 'Your Code in here End If regards, Tim |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if strcomp(Current,Temp,1) = 0 then
or if ucase(Current) = Ucase(Temp) then -- Regards, Tom Ogilvy "Sabo, Eric" wrote in message ... I have the following: If current = temp then End if My problem is the following: Current = Apple temp = APPLE How can I compare these two strings without the case involved. I want the if statement to treat them as equal. Thank, Eric Sabo |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There's a setting that you can use that makes text comparisons case insensitive.
Add Option Compare Text Right at the top of the module--outside any procedure. Then you can just compa if current = temp then If case never matters for any procedure in that module, it's an easy fix. "Sabo, Eric" wrote: I have the following: If current = temp then End if My problem is the following: Current = Apple temp = APPLE How can I compare these two strings without the case involved. I want the if statement to treat them as equal. Thank, Eric Sabo -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Compare Strings | Excel Discussion (Misc queries) | |||
Compare two strings | Excel Worksheet Functions | |||
Compare strings of data | Excel Programming | |||
Compare the strings | Excel Discussion (Misc queries) | |||
VBA search and compare strings | Excel Programming |