I have the following in cell data/formula:
A1: 60
A2: 8000
A3: 4000
A4: =COS(A1*PI()/180)*A2/1000
I am trying to run this very simple code snippet in my project:
Dim x as Double, y as Double
x = Sheet1.Range("A3")
y = Sheet1.Range("A4")
If (x / 1000) = y Then
z = z + 0.0001
Debug.Print z
End If
I would expect this comparison to evaluate as true. However, it never does so and thus does not execute my manipulation on z. Both x and y are type Double
. The Locals window also tells me these values are 4000 and 4, and when I use Debug.Print
after setting x and y it tells me the same thing.
I know this seems like it should be a really easy problem, but I wouldn't post it here if it were working. What am I missing that is causing this logical failure?