Looking for some help.
I have the following formula which highlights a cell ok if the number in cell A1 is greater than B1 but I'm not sure how to expand the formula for multiple rows, I have around 200 rows of data that I would like to highlight when the number in the A column is greater than its corresponding number in the B Column etc
Sub highlight()
Dim rg As Range
Dim cond1 As FormatCondition
Set rg = Range("A1", Range("A1").End(xlDown))
rg.FormatConditions.Delete
Set cond1 = rg.FormatConditions.Add(xlCellValue, xlGreater, "=$B$1")
With cond1
.Interior.Color = RGB(204, 255, 255)
End With
End Sub
I have the following formula which highlights a cell ok if the number in cell A1 is greater than B1 but I'm not sure how to expand the formula for multiple rows, I have around 200 rows of data that I would like to highlight when the number in the A column is greater than its corresponding number in the B Column etc
Sub highlight()
Dim rg As Range
Dim cond1 As FormatCondition
Set rg = Range("A1", Range("A1").End(xlDown))
rg.FormatConditions.Delete
Set cond1 = rg.FormatConditions.Add(xlCellValue, xlGreater, "=$B$1")
With cond1
.Interior.Color = RGB(204, 255, 255)
End With
End Sub