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

Re: Pivot Tables: Alternative to PivotSelect? by Paul

Paul
Sun Oct 12 02:51:57 CDT 2008

I'm still looking for an answer, even if it's "no, you can't do it".


On Oct 8, 12:13=A0pm, Paul Martin <melbournef...@gmail.com> wrote:
> Hi guys
>
> In VBA, we're accustomed to referencing ranges rather than selecting
> them (which is of course what the macro recorder does). =A0However, 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)
>
> =A0 =A0 pt.PivotSelect "CategoryDemand[All;Total]", xlDataAndLabel, True
> =A0 =A0 Selection.Interior.ColorIndex =3D 43
> =A0 =A0 Selection.Font.Bold =3D True
>
> So my question is, can I reference this range and format it, avoiding
> PivotSelect?
>
> Thanks in advance
>
> Paul Martin
> Melbourne, Australia