Hi all,
I have a sheet with around 30 pivots on it displayed in two columns - pivots in the left columns display data per day, data in the right columns display the same data but per month
I have a slicer that links to all the day pivots (so about 15 pivots), that I need to amend daily to show the date range between today and today - 30. Basically I'm unselecting the last selected item on the slicer list, and selecting todays date. The raw data behind the pivots is updated daily to include the latest lines, so is ever-increasing in size. Because of this constant expansion of data, I can't filter one of the pivots directly, as to do that it firsts clears all the filters which expands the pivot to fit all the dates into it - with the monthly pivots right next door, eventually it'll bump into it and create an error!
Having tried out the macro recorder, I get a long list of actions to select/deselect each slicer item, which is no good to me due to the increasing size of the list each day. After some searching about I came across this code which I've tailored for my own file and what I want to achieve:
My issue is that I can't seem to get the code to check if a date is greater than/equal to, presumably because it's in string format it's like comparing text against text and therefore won't treat it as a number. I get that, but how can I look at the slicer item as a date, rather than as text so I can check the <= / >= part?Please Login or Register to view this content.
Bookmarks