Sub
ChangeMarker()
Dim
Mainhazard
As
String
Mainhazard = ActiveCell.Value
Mainhazard = Right(ActiveCell.Value, 3)
Dim
Subhazard
As
String
Subhazard = ActiveCell.Offset(i, 0).Value
Subhazard = Right(ActiveCell.Offset(i, 0).Value, 3)
For
i = 1
To
Rows.Count
Next
i
If
Mainhazard - Subhazard < 10
Then
Range(ActiveCell.Offset(1, 5), ActiveCell.Offset(1, 8)).
Select
"=NOT(B$1=F2)"
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=NOT(ActiveCell.Offset(0, 1).Range(ActiveCell, ActiveCell.Offset(0,3))=ActiveCell.Offset(1,5).Range(ActiveCell, ActiveCell.Offset(0,3))"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With
Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 5296274
.TintAndShade = 0
End
With
Selection.FormatConditions(1).StopIfTrue =
False
End
If
End
Sub