Hello All,

This is my first post and I should mention that I am very new to VBA and am in a jam. So I have a spread sheet column A has a category (car names for example), column C has 1 value, column D has another value.

So what I want to do is highlight the associated column A category if the absolute value of column c - column d is >= 5.

I am able to so this for one row using conditional formatting but dont want to have to go through the steps of doing a conditional formart for every row. Is there anyway to create a conditional formatting macro that uses relative reference so for example there is data in row 999 i can hit a command ctrl + (a key) and it will highlight cell A999 if the abs of column c - column d is >=5?

I have the following so far:

Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+z
'
ActiveCell.FormulaR1C1 = "=ABS(RC[-3]-RC[-2])"
Range("A2").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$F$2>=5"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub

I want to be able to now then go to cell A3, hit ctrl+z and have it highlight cell A3 if the value abs value of column c - column d is >=5.

Hopefully this makes sense?

Thank you for your help.

-Adam