TableName = "TestTable"
ActiveSheet.PivotTables(TableName).PivotSelect "Alpha", xlDataAndLabel + xlFirstRow, True
With Selection
.Interior.Color = RGB(149, 179, 215)
End With
ActiveSheet.PivotTables(TableName).PivotSelect "Beta", xlDataAndLabel + xlFirstRow, True
With Selection
.Interior.Color = RGB(149, 179, 215)
End With
ActiveSheet.PivotTables(TableName).PivotSelect "Gamma", xlDataAndLabel + xlFirstRow, True
With Selection
.Interior.Color = RGB(149, 179, 215)
End With
ActiveSheet.PivotTables(TableName).PivotSelect "Delta", xlDataAndLabel + xlFirstRow, True
With Selection
.Interior.Color = RGB(149, 179, 215)
End With
This is the present manner that I am having to cycle through all the entries in my pivot table. Unfortunately, planning ahead, I forsee that there will be more entries than just Alpha, Beta, Gamma, and Delta, and those may potentially be absent.
Thus, I am trying to find out if there is some way to cycle through ALL entries with a For...Each loop to cycle through all pivot labels, regardless if they were listed before.
Any help would be appreciated, including a manner in which I can re-write the code above to remove the "Selection" part, because that's just being annoying with screen flashes.
Bookmarks