View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rachel Costanza[_2_] Rachel Costanza[_2_] is offline
external usenet poster
 
Posts: 12
Default Macro for HEAT chart - THANKS IN ADVANCE!

Thanks Otto!

How can I make the color coding start in column D?

"Otto Moehrbach" wrote:

Rachel
Find the line of code:
i.EntireRow.Interior.ColorIndex = TheColor
and replace it with:
Range(Cells(i.Row, 1), Cells(i.Row, 16)).Interior.ColorIndex = TheColor
all in one row.
HTH Otto

"Rachel Costanza" wrote in
message ...
This is great! What is the code to stop the colors from streaming into
rows
after column P ?

"Otto Moehrbach" wrote:

Rachel
Something like this perhaps. I assumed that the reference numbers
are
in Column P. HTH Otto
Sub ColorRows()
Dim rColP As Range, i As Range
Dim TheColor As Long
Set rColP = Range("P2", Range("P" & Rows.Count).End(xlUp))
For Each i In rColP
Select Case i.Value
Case 1 To 30: TheColor = 4
Case 31 To 60: TheColor = 6
Case 61 To 90: TheColor = 46
Case 91 To 700: TheColor = 3
End Select
i.EntireRow.Interior.ColorIndex = TheColor
Next i
End Sub
"Rachel Costanza" <Rachel wrote in
message ...
I am trying to create a macro that will color code the rows in a
spreadsheet.

The days for reference are in column O,P.

For days between 1-30 i need the rows to turn green
For days between 31-60 i need the rows to turn yellow
For days between 61-90 i need the rows to turn orange
For days between 91-700 i need the rows to turn red.

Thanks in advance for your time.