hattrick_123
New Member
- Joined
- Apr 5, 2011
- Messages
- 7
Hi there <?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o> </o>
I am looking to write a macro that makes the last 7 days in the pivot chart visible. I am assuming all days are visible before the macro is run. So then when the macro is run, only the last 7 days are visible in the pivot chart. <o></o>
<o> </o>
My initial thinking is to make all the dates invisible/hidden and then make the last 7 days visible. But I am not too sure if this is the best method?<o></o>
<o> </o>
The below macro is a simple recording of the “date” being filtered to only show last weeks days. <o></o>
<o> </o>
How do I write the below code so it could be written generically so I can put it in a loop to do every pivot chart in a workbook? I can work on the loop myself. I just need a hand with this part please.<o></o>
<o> </o>
<o> </o>
<o> </o>
<o> </o>
Thanks<o></o>
<o> </o>
I am looking to write a macro that makes the last 7 days in the pivot chart visible. I am assuming all days are visible before the macro is run. So then when the macro is run, only the last 7 days are visible in the pivot chart. <o></o>
<o> </o>
My initial thinking is to make all the dates invisible/hidden and then make the last 7 days visible. But I am not too sure if this is the best method?<o></o>
<o> </o>
The below macro is a simple recording of the “date” being filtered to only show last weeks days. <o></o>
<o> </o>
How do I write the below code so it could be written generically so I can put it in a loop to do every pivot chart in a workbook? I can work on the loop myself. I just need a hand with this part please.<o></o>
<o> </o>
<o> </o>
Code:
[COLOR=black][FONT=Verdana]Sub Macro2()
'
' Macro2 Macro
'<o:p></o:p>[/FONT][/COLOR]
[COLOR=black][FONT=Verdana]'
ActiveSheet.PivotTables("PivotTable2").PivotFields("date").PivotFilters.Add _
Type:=xlDateLastWeek
End Sub<o:p></o:p>[/FONT][/COLOR]
<o> </o>
Thanks<o></o>