How to use VBA to display a Pivot Item- Aladin?


Posted by Andrew Corkery on May 29, 2001 9:25 AM

I have a problem when I want to change the value of a pivot table item that is the page field. The following code gives a 1004 error.

Sub Macro4()

ActiveSheet.PivotTables("WeeklyData-EndLastWeek").PivotFields("Date").CurrentPage = "30/04/2001"

End Sub

Can any one offer assistance?

Thank you.

Posted by Aladin Akyurek on May 29, 2001 9:58 AM

Also for the VBA programmers... (NT)

Sub Macro4() ActiveSheet.PivotTables("WeeklyData-EndLastWeek").PivotFields("Date").CurrentPage = "30/04/2001" End Sub



Posted by Barrie Davidson on May 29, 2001 10:11 AM

Sub Macro4() ActiveSheet.PivotTables("WeeklyData-EndLastWeek").PivotFields("Date").CurrentPage = "30/04/2001" End Sub

Hi Andrew, how is your page field formatted? I think your syntax ("30/04/2001") doesn't match the formatting of the page field. I made some small data and tested (my page field was formatted "30-Ape-2001") and it worked okay for me as long as I specified "30-Ape-2001" in the line.

Hope this helps you out.

Barrie