ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Modify Pivot Table Page Field (https://www.excelbanter.com/excel-programming/330349-modify-pivot-table-page-field.html)

DynamiteSkippy

Modify Pivot Table Page Field
 
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

Debra Dalgleish

Modify Pivot Table Page Field
 
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


DynamiteSkippy wrote:
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



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


DynamiteSkippy

Modify Pivot Table Page Field
 
Thanks Debra... It works great.

"Debra Dalgleish" wrote:

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


DynamiteSkippy wrote:
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



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com