Hi all,

I have a Pivot Table with 4 PivotRows and 12 DataFields (which may change), thus 16 columns in total currently, and I want to apply Conditional Formatting to the data in all but the first of them, using VBA. There's 2 reasons for this: firstly, there's 5 conditional formattings for each column, so at present I need to apply CF 75 times. Secondly, if the PT is refreshed, I might have to reapply CF, so automation seems to be the way to go.

Is there a property of PivotTables that captures all of the column headers?
DataLabelRange conveniently gives me the range of the 12 DataField labels but not the RowRange labels.
RowRange gives me the labels but also the complete columns.
At present, I can capture what I'm looking for with:

Please Login or Register  to view this content.
Is there a more eloquent way of achieving this? I.e., is there a property of PivotTables that captures the all the column headers? The line above works, but seems unnecessarily lengthy.

My intention is to loop through each cell in rngToFormat and apply 5 Conditional Formats to each cell (and thus each column). Does this sound like the correct approach?

TIA, Paul