Specifying dates from pivot table?

Brink57331

New Member
Joined
Dec 18, 2017
Messages
11
I'm getting data each week in a pivot table and need to pull data based on a specified date range (or the most recent X full weeks). I got this by recording macro
With ActiveWorkbook.SlicerCaches("Slicer_Created1")
.SlicerItems("1/6/2018 - 1/10/2018").Selected = False
.SlicerItems("11/25/2017 - 12/1/2017").Selected = True
.SlicerItems("12/16/2017 - 12/22/2017").Selected = True
.SlicerItems("12/2/2017 - 12/8/2017").Selected = True
.SlicerItems("12/23/2017 - 12/29/2017").Selected = True
.SlicerItems("12/30/2017 - 1/5/2018").Selected = True
.SlicerItems("12/9/2017 - 12/15/2017").Selected = True
.SlicerItems("10/14/2017 - 10/20/2017").Selected = False
.SlicerItems("10/21/2017 - 10/27/2017").Selected = False

Since the date range changes I'm looking for an option to set the start date and end date. Preferably a popup calendar but a message box would work.

Thanks in advance for the help
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,216,480
Messages
6,130,905
Members
449,606
Latest member
jaybar0812

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