VBA Pivot Table Change Criteria - Help?!


L

Louise

I have a worksheet called Front where there is a field populated with a date
in dd/mm/yyy format (in cell B10).
On this worksheet I have a button which runs the below code and should look
at a worksheet called Pivots which contains 10 pivot tables. I need the code
to change the Page value of each of these pivots to the date populated in
cell B10 on the Front worksheet.
The source data and the pivot has the date in the same format as each other
and the Pivots are named PivotTable6 etc etc...

Sheets("Pivots").Select
ActiveSheet.PivotTables("PivotTable6").PivotFields("Invoice
Month").CurrentPage = ActiveSheet.Range("B10").Value

When I run this code it give me an error advising:

Unable to set the _Default property of the Pivot Item class

Any ideas appreciated as his is driving me crazy!

Thanks!
 
Ad

Advertisements


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