I have a worksheet which contains a list of tasks, one on each row. Column A is the task name, column B is the date when it must be done and Column C is the person who must do it. Column D is used to indicate when it's been done. If this column contains anything, then the background colour for whole row should be grey, otherwise it should be white.
I'm thinking the worksheet_change
event is the best way to handle this. I suppose I could use Conditional Formatting, but that seems to be vulnerable to breaking if cells get dragged around - I need this to be as "bullet-proof" as possible!
In pseudo-code, I'm trying to achieve the following:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target includes a cell in column "D"
If "D" is not empty
Set entire row background to grey
Else
Set entire row background to white
End If
End If
End Sub
Can anybody give me any pointers about the best way to implement this? Am I even on the right lines, or is there a better way?