PC Review


Reply
Thread Tools Rate Thread

How do I change the date in a pivot table pagefield using VBA

 
 
st
Guest
Posts: n/a
 
      15th Jul 2008
My pivot table shows one day's worth of data. I have multiple
departmenst in the rows, and 3 categories of expenditures in the
columns. I use the Page area to show a date. How do I use VBA to
change the date to today()-1 (yesterday).

Thanks
 
Reply With Quote
 
 
 
 
st
Guest
Posts: n/a
 
      16th Jul 2008
I defined the date I want to use w/ dim and then used this code:

Dim pvtdate as date

pvtdate = Worksheets("By Trade").Range("d75").Text

ActiveSheet.PivotTables("PivotTable1").PivotCache.refresh
ActiveSheet.PivotTables("PivotTable1").PivotFields("DT_TRANS_DATE"). _
CurrentPage = pvtdate

st wrote:
> My pivot table shows one day's worth of data. I have multiple
> departmenst in the rows, and 3 categories of expenditures in the
> columns. I use the Page area to show a date. How do I use VBA to
> change the date to today()-1 (yesterday).
>
> Thanks

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Change to US Date Format - Why? Louise Microsoft Excel Misc 2 26th Apr 2010 01:04 PM
DATE FORMAT CHANGE FROM EXCEL WORKSHEET TO PIVOT TABLE Wendy Microsoft Excel Misc 0 19th Nov 2008 12:54 AM
how to change date formating-grouped by month in pivot table =?Utf-8?B?WWFow71h?= Microsoft Excel Misc 4 24th Jun 2006 09:15 AM
Pivot Table PageField Todd Huttenstine Microsoft Excel Programming 4 21st Apr 2004 09:46 PM
How to find the current pagefield of a pivot table? Tama Microsoft Excel Programming 0 22nd Dec 2003 05:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:26 AM.