dhylbert
12-11-2012, 11:22 AM
I am trying to set up a macro in VBA to do the following: When a user changes a cell, I want the cell's fill color to change. I need it to work in conjunction with existing macro witch I will post below. If someone removes or adds an "X" in the columns I want to easily see that it was changed. Please Help..
Sub CFO_OC()
Dim LR As Long
Dim i As Long
LR = Range("D" & Rows.Count).End(xlUp).Row
For i = 2 To LR
If Range("D" & i).Value = "Facility CFO" Then
Range("f" & i).Value = "X"
Range("j" & i).Value = "X"
Range("n" & i).Value = "X"
Range("r" & i).Value = "X"
Range("v" & i).Value = "X"
Range("z" & i).Value = "X"
Range("ad" & i).Value = "X"
Range("ah" & i).Value = "X"
Range("al" & i).Value = "X"
Range("ap" & i).Value = "X"
Range("at" & i).Value = "X"
Range("ax" & i).Value = "X"
Range("bb" & i).Value = "X"
Range("bf" & i).Value = "X"
Range("bj" & i).Value = "X"
Range("bn" & i).Value = "X"
Range("br" & i).Value = "X"
Range("bv" & i).Value = "X"
Range("bz" & i).Value = "X"
Range("cd" & i).Value = "X"
Range("ch" & i).Value = "X"
Range("cl" & i).Value = "X"
Range("cp" & i).Value = "X"
End If
Next i
End Sub
Sub CFO_OC()
Dim LR As Long
Dim i As Long
LR = Range("D" & Rows.Count).End(xlUp).Row
For i = 2 To LR
If Range("D" & i).Value = "Facility CFO" Then
Range("f" & i).Value = "X"
Range("j" & i).Value = "X"
Range("n" & i).Value = "X"
Range("r" & i).Value = "X"
Range("v" & i).Value = "X"
Range("z" & i).Value = "X"
Range("ad" & i).Value = "X"
Range("ah" & i).Value = "X"
Range("al" & i).Value = "X"
Range("ap" & i).Value = "X"
Range("at" & i).Value = "X"
Range("ax" & i).Value = "X"
Range("bb" & i).Value = "X"
Range("bf" & i).Value = "X"
Range("bj" & i).Value = "X"
Range("bn" & i).Value = "X"
Range("br" & i).Value = "X"
Range("bv" & i).Value = "X"
Range("bz" & i).Value = "X"
Range("cd" & i).Value = "X"
Range("ch" & i).Value = "X"
Range("cl" & i).Value = "X"
Range("cp" & i).Value = "X"
End If
Next i
End Sub