Modify Pivot Table Page Field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use a cells contents--in H26 on Sheet1- and trying to modify a
pivot table page field--on Sheet2.

The code is below.

ActiveSheet.PivotTables("PivotTable2").PivotFields("Product
Line").CurrentPage _
= Range("h26").Value

It may be using the .visible property but I can't seem to use that
correctly.Does anyone have any ideas?

Thanks
 
Fully qualify the reference to range("H26"), or Excel will assume that
it's on Sheet2:

ActiveSheet.PivotTables("PivotTable2") _
.PivotFields("Product Line").CurrentPage _
= Sheets("Sheet1").Range("H26").Value
 
Thanks Debra... It works great.

Debra Dalgleish said:
Fully qualify the reference to range("H26"), or Excel will assume that
it's on Sheet2:

ActiveSheet.PivotTables("PivotTable2") _
.PivotFields("Product Line").CurrentPage _
= Sheets("Sheet1").Range("H26").Value
 
Back
Top