View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Failed Comparison... why?

Try using a message box to see what each returned value looks like. If one
has quote marks and the other doesn't it means they are not both text.
Sub ckType()
MsgBox ActiveSheet.Range("A1").Value & " " & _
Sheets("Sheet2").Range("A1").Value 'all one line
End Sub

Also try making the comparison using the Trim function to see if there are
leading and trailing spaces that are causing the problem. IF(TRIM(B1) =
TRIM(Sheet2!A1), "OK", "OS")

"shelfish" wrote:

No. I just gave a simple example of a very complex situation. Sorry
for the typo. I'm really not a newb, but I have yet to find anyone I
work with who can figure it out either. I am hoping someone in here is
up for the challenge...

Put a different way, can anyone name a reason why two cells, which are
identical in every way that I can detect, would not be considered
equal by Excel?

I know about 4 experts who would be really impressed by your answer.
And, of course, I would really appreciate finding a solution.

Thanks,
S.