View Single Post
  #11   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 do I use CountIf when I am looking to count numbers between 30 and 60?


"Otto Moehrbach" wrote:

Rachel
You can use formulas that look at the numbers. To count colors would
take VBA. For instance, to get the number of rows that have 31 to 60, use:
=CountIf(P2:P50,"<=60") - CountIf(A1:A50,"<=31")
Otto

"Rachel Costanza" wrote in
message ...
Also, how do I count the number of rows assigned to each color (red,
yellow,
orange, green) i.e 14 Red, 20 Green as of a constant date?

"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.