I have a variable, Diff as a double. (values are a sample from my Workbook)
Dim Diff As Double
Sheets(Sheet1).Activate
Diff = 4382.98-4117.34-265.64
Values for calculating Diff come from cells formatted as numbers. I then use Diff as an argument in an if statement.
If Diff <> 0 Then
ActiveSheet.Range(A2).Value = 265.64 + Diff
End If
Diff should equal 0, but the if statement is proceeding as if the condition is true. I have similar if statements that do not have problems like this. Do I need to format my values differently?
Edit: Had 43892.98 instead of 4382.98 Edit2: Had 256.64 instead of 265.64