I'm stuck trying to figure out how to highlight the .PivotFields("Client Detail Account") when .PivotFields("Detail Service Code").PivotItems("ZBA MASTER ACCOUNT MAINT ") is greater or equal to 1. Right now it is just highlighting the ZBA MASTER ACCOUNT MAINT Pivot Item within the Detail Service Code Pivot Field as the code shows. Any assistance with adding the little bit I'm missing would be great!
Sub Colors_Click()
Dim c As Range
With ActiveSheet.PivotTables("Pivottable1")
' reset default formatting
With .TableRange1
.Font.Bold = False
.Interior.ColorIndex = 0
End With
' apply formatting to each row if condition is met
For Each c In .PivotFields("Detail Service Code").PivotItems("ZBA MASTER ACCOUNT MAINT ").DataRange.Cells
If c.Value >= 1 Then
With .TableRange1.Rows(c.Row - .TableRange1.Row + 1)
.Interior.ColorIndex = 6
End With
End If
Next
End With
End Sub
Cheers
Bookmarks