View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
st st is offline
external usenet poster
 
Posts: 3
Default How do I change the date in a pivot table pagefield using VBA

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