I am trying to write a piece of code that will apply conditional formatting to the ActiveCell:
The ActiveCell will always be in Column B, but the row number will change each time the macro is run.
The cell the conditional formatting refers to will always be in Column G.
However the row the cell is in should be the same row as the ActiveCell.
I can't work out how to write a code that will make the row number of the formula the same as the ActiveCell.
Below is what I have , but it doesn't work! Any help would be greatly appreciated.
The ActiveCell will always be in Column B, but the row number will change each time the macro is run.
The cell the conditional formatting refers to will always be in Column G.
However the row the cell is in should be the same row as the ActiveCell.
I can't work out how to write a code that will make the row number of the formula the same as the ActiveCell.
Below is what I have , but it doesn't work! Any help would be greatly appreciated.
Code:
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=Offset(0, 5) = 0"
Selection.FormatConditions(1).Interior.ColorIndex = 27