Colour code Pivot Row labels - number of labels variable

[Closed]
Report
Posts
3
Registration date
Sunday February 22, 2015
Status
Member
Last seen
March 5, 2015
-
Hi
I have a macro in progress of development to create pivot table based on a constantly varying number of row labels eg "A1", "B16", "B32", "C18" etc - all are text
Depending on the code, I want Excel to colour code the cell interior of each label based on its value. My current code just steps through all the lines and does nothing; obviously I am missing something basic here - can anyone assist?

This is the piece of code so far:

=================================
'Apply Colours to Row Labels

Dim LC As Long

LC = pt.RowRange.Cells.Count

Dim MyRng As Object

Set MyRng = Range("E5" & LC - 1)

Dim cell As Object

For Each cell In MyRng

Select Case cell.Value

Case Is = "B50", "B60", "B70", "B30", "B90", "MGR", "BMO", "BO1", "BO2"
cell.Interior.Color = 5287936

Case Is = "B61", "B65", "B71", "B15", "B31", "B48"
cell.Interior.Color = 10498160


Case Is = "B64", "B10", "B20", "B15", "B25", "B32", "B37", "B38", "B42"
cell.Interior.Color = 49407

Case Is = "B62", "B63", "B75", "B35", "B39", "B34", "B33", "B41", "B40", "B36", "B46"
cell.Interior.Color = 13434879

Case Is = "Grand Total"
cell.Interior.Color = xlNone

Case Else
cell.Interior.Color = 65535

End Select

Next
==============================================