I attached the excel spreadsheet that I'm working in. This procedure goes through each row and checks to see if the fourth column >= (the second column + 0.01) and if it is then it highlights it yellow.
The problem I'm having is on row 74. The value of the fourth column is 0.821 and (the second column + 0.01)= 0.821 (I even verified these values in debug mode). However, it continues to go into the first if statement in red text below rather than the ElseIf right below it. Anyone have any suggestions?
Code:
Public Const ReliabMarg = 0.01
Sub reliab()
Dim ReliabLimit As Double
Range("A1").Activate
Do Until IsEmpty(ActiveCell) = True And IsEmpty(ActiveCell.Offset(1, 0)) = True
If IsEmpty(ActiveCell) Then
ActiveCell.Offset(1, 0).Activate
ElseIf IsNumeric(ActiveCell.Offset(0, 1)) = False Then
ActiveCell.Offset(1, 0).Activate
ElseIf IsNumeric(ActiveCell.Offset(0, 1)) = True Then
ReliabLimit = ActiveCell.Offset(0, 1).Value + ReliabMarg
If ActiveCell.Offset(0, 3).Value < ReliabLimit Then
ActiveCell.Offset(1, 0).Activate
ElseIf ActiveCell.Offset(0, 3).Value >= ReliabLimit Then
ActiveCell.Offset(0, 3).Interior.ColorIndex = 6
ActiveCell.Offset(1, 0).Activate
End If
End If
Loop
End Sub