PDA

View Full Version : Cell Color Change VBA Help Needed



dhylbert
12-11-2012, 02:10 PM
I am beating my head up against a wall because I cant figure this out.....

I need to show when a cell has been changed and only that cell. I want that cell's fill color to change. I have the following macro..and when someone changes the value of "X" or puts an "X" in a cell that is identified not to have one, I need that cell to be highlighted.....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 = ""
Range("r" & i).Value = "X"
Range("v" & i).Value = "X"
Range("z" & i).Value = ""
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 = ""
Range("ch" & i).Value = "X"
Range("cl" & i).Value = "X"
Range("cp" & i).Value = "X"

End If
Next i
End Sub

CodeNinja
12-11-2012, 02:42 PM
See:
http://www.vbaexpress.com/forum/showthread.php?t=44691

Please do not post multiple posts about the same question.