Thread: compare values
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default compare values

What that tells me is there has to be more to this than what you have posted.
Are there other formulas involved. Is your code copeid exactly. Is there more
to the code... Since you are obviously not using option explicit and
declaring variable spelling counts so if you have retyped the code for your
question then you need to review that.

Perhpas try opening a new workbook and following your question exactly as
posted and let us know how that goes...
--
HTH...

Jim Thomlinson


"Steve" wrote:

I'm really happy for you but it doesn't really help me much does 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