B
Brian
Hello,
I have rows of data ( a1:e1, a2:e2, a3:e3, etc.) I would like to put a
letter in column (f1: f100) that would change the background color of that
row of data ( a1:e1)
I think i have to use a WorkSheet_change event. I've found the following
code but don't understand how to change the background color for the row of
data. If i put R in f1 the row a1:e1 would change to red background.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("F1:F100")) is Nothing Then
Select Case Target
Case Is = R
icolor = Red
Case Is =G
icolor = Green
Case Is = B
icolor = Blue
Case Is = Y
icolor = Yellow
Case Is = M
icolor = Magenta
Case Is = C
icolor = Cyan
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
Thanks
Brian
I have rows of data ( a1:e1, a2:e2, a3:e3, etc.) I would like to put a
letter in column (f1: f100) that would change the background color of that
row of data ( a1:e1)
I think i have to use a WorkSheet_change event. I've found the following
code but don't understand how to change the background color for the row of
data. If i put R in f1 the row a1:e1 would change to red background.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("F1:F100")) is Nothing Then
Select Case Target
Case Is = R
icolor = Red
Case Is =G
icolor = Green
Case Is = B
icolor = Blue
Case Is = Y
icolor = Yellow
Case Is = M
icolor = Magenta
Case Is = C
icolor = Cyan
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
Thanks
Brian