Hi, there is something that I can't figure out in this code,
In row 3, the value of cell(3,2) is 0.85
Logically, the code should read sheet1.cells(3,2)>= diff05 "as true" and sheet1.cells(3,2)< diff05 + 0.05 "as false"
But it is returning sheet1.cells(3,2)< diff05 + 0.05 "as true"
If I remove diff05+0.05 and I just put 0.85, it reads "false", what may be the problem?
Code:
Sub test()
Dim i As Integer
Dim diff05 As Double
diff05 = 0.8
For i = 2 To 4
If Sheet1.Cells(i, 2).Value >= diff05 And Sheet1.Cells(i, 2).Value < diff05 + 0.05 Then
Sheet1.Cells(i, 11) = Sheet1.Cells(i, 2).Offset(0, 6)
End If
Next
End Sub
Logically, the code should read sheet1.cells(3,2)>= diff05 "as true" and sheet1.cells(3,2)< diff05 + 0.05 "as false"
But it is returning sheet1.cells(3,2)< diff05 + 0.05 "as true"
If I remove diff05+0.05 and I just put 0.85, it reads "false", what may be the problem?