-
This is only set for 2 colours, but you get the idea.
[vba]
Dim rng As Range
Dim varColour As Variant
Dim i As Integer
varColour = Array("Orange", "Yellow")
For i = LBound(varColour) To UBound(varColour)
ActiveSheet.PivotTables("PivotTable1").PivotSelect varColour(i), xlDataAndLabel
For Each rng In Selection
If rng.Column = 1 Or (rng.Column <> 1 And rng.Value <> "") Then
Select Case varColour(i)
Case "Orange": rng.Interior.ColorIndex = 45
Case "Yellow": rng.Interior.ColorIndex = 6
End Select
rng.Interior.Pattern = xlSolid
End If
Next rng
Next i
[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules