Pivot Tables: Alternative to PivotSelect?

P

Paul Martin

Hi guys

In VBA, we're accustomed to referencing ranges rather than selecting
them (which is of course what the macro recorder does). However, when
referencing ranges within a PivotTable, I don't seem to be able to
avoid PivotSelect and am wondering if there is one.

For example, in the following code, I am trying to format the total
columns of a ColumnField (pt is a declared PivotTable)

pt.PivotSelect "CategoryDemand[All;Total]", xlDataAndLabel, True
Selection.Interior.ColorIndex = 43
Selection.Font.Bold = True

So my question is, can I reference this range and format it, avoiding
PivotSelect?

Thanks in advance

Paul Martin
Melbourne, Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top