Thread: compare values
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Atishoo Atishoo is offline
external usenet poster
 
Posts: 267
Default compare values

Works fine for me too! Are you running it with the right worksheet? stick
with worksheets ("your worksheet name") and end with either side of your sub
to be sure! otherwise cant figure it!

"Jim Thomlinson" wrote:

Your code works fine for me. I get True as the final msgbox.
--
HTH...

Jim Thomlinson


"Steve" wrote:

I have a problem in a macro where I'm comparing two values. They appear to
be the same but when tested in the code, are different. I recreated the
problem using this scenario:

A1-D1 = .2003, .0542, .0257 and 0, respectively.
A2-D2 have the same values.

E1 = .2802
E2 = the formula sum(A2:D2)

When I run the following code I get the message box values ".2802", ".2802"
and "False". The funny thing is...if I type a formula in the worksheet
=E1=E2 I get "True":

Sub testit()
frst = Range("E1").Value
Scnd = Range("E2").Value
MsgBox frst
MsgBox Scnd
MsgBox (frst = Scnd)
End Sub