If I understand your question properly, you want to manipulate the colour of column B when you enter a new number if the number in column A has increased or decreased in value from the previously entered number, the formula isn't anything to do with it?
I just posted on how to determine the previous value of a cell here: Detecting what value was in a cell prior to a change
You could apply that like this at the worksheet level:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim OldValue As Variant, NewValue As Variant
'If in a column other than A then end
If Not Target.Column = 1 Then End
'If the entered value is not numeric then clear shade and end
If Not IsNumeric(Target.Value) Then
Target.Offset(0, 1).Interior.Pattern = xlNone
End
End If
'Populate NewValue with value of target
NewValue = Target.Value
'Turn the events off
Application.EnableEvents = False
'Undo the change
Application.Undo
'Populate OldValue with the undone value
OldValue = Target.Value
'Make the target the NewValue once again
Target.Value = NewValue
'Do a comparison on NewValue and OldValue
If NewValue > OldValue Then
'Shade Green
With Target.Offset(0, 1).Interior
.Pattern = xlSolid
.Color = 5287936
End With
ElseIf NewValue < OldValue Then
'Shade Red
With Target.Offset(0, 1).Interior
.Pattern = xlSolid
.Color = 255
End With
Else
'Clear shade
Target.Offset(0, 1).Interior.Pattern = xlNone
End If
Application.EnableEvents = True
End Sub