M
Michael
Hi,
I am using the following piece of VBA code to color cells in column
range, M10 to M59, uniquly based on their values.
Set rngArea = ActiveSheet.Range("M10:M59")
intColor = 2
On Error Resume Next
For Each rngCellA In rngArea
If rngCellA.Value <> "" Then
Err.Clear
colValue.Add rngCellA.Value, "MB" & rngCellA.Value
If Err = 0 Then
intColor = intColor + 1
For Each rngCellB In rngArea
If rngCellB.Value = rngCellA.Value Then
rngCellB.Interior.ColorIndex = intColor
End If
Next rngCellB
End If
Else
rngCellA.Interior.ColorIndex = 2
End If
Next rngCellA
Q:
Say, if cell M10 color is red, then I want cells C10:F10 to be red
automatically. If cell M11 color is green, then I want cells C11:F11
to be green, and so on.
What should I add to the following code to force him to do so?
Thanks,
Mike
I am using the following piece of VBA code to color cells in column
range, M10 to M59, uniquly based on their values.
Set rngArea = ActiveSheet.Range("M10:M59")
intColor = 2
On Error Resume Next
For Each rngCellA In rngArea
If rngCellA.Value <> "" Then
Err.Clear
colValue.Add rngCellA.Value, "MB" & rngCellA.Value
If Err = 0 Then
intColor = intColor + 1
For Each rngCellB In rngArea
If rngCellB.Value = rngCellA.Value Then
rngCellB.Interior.ColorIndex = intColor
End If
Next rngCellB
End If
Else
rngCellA.Interior.ColorIndex = 2
End If
Next rngCellA
Q:
Say, if cell M10 color is red, then I want cells C10:F10 to be red
automatically. If cell M11 color is green, then I want cells C11:F11
to be green, and so on.
What should I add to the following code to force him to do so?
Thanks,
Mike