Pivot table help

Jamma

New Member
Joined
Sep 19, 2018
Messages
6
Hi,

Each week I need to report the departments numbers to the stakeholders and they require the last 12 weeks of data split into last 6 weeks and previous 6 weeks.

Is there a way for the tables to move along each week when I add new data without having to go in and adjust the dates?

Thank you.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
While there is a filter for This Year, This Month, Previous Month... etc, not for your specific case.
However, I have had the same conundrum. You can create a macro to update the filters based on a date calculation.

I use a calculation on a separate sheet.
For the below code, the cell feeding the EndFilterDate is just a TODAY() function and the BeginFilterDate is a calculated field. I then feed that to a number of PivotTables through a link TimeLine Slicer. I do not have it automatically run in any way to avoid conflicts if a user wanted a non-standard date range.

Code:
Sub Use_Defined_Date_Range()
'
' Macro13 Macro
'
Dim BeginFilterDate As Date
Dim EndFilterDate As Date

BeginFilterDate = Worksheets("Charting Date Range Selector").Range("B3").Value
EndFilterDate = Worksheets("Charting Date Range Selector").Range("C3").Value

    ActiveWorkbook.SlicerCaches("NativeTimeline___Date").TimelineState. _
        SetFilterDateRange BeginFilterDate, EndFilterDate
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,716
Messages
6,174,069
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top