This is a semi-re-post so will apologize in advance.
I am trying to write code that will filter on a specific date range in a pivot table using my "date" filter (requester insists on a pivot table).
Example, I ran a daily report today and I want to show dates for the current week (mon-wed) without having to manually select them.
I have looked at multiple postings across other forums and the coding just seems too complicated.
Have attached a sample file of what is needed for my work.
-In Column B10 has the date filter. I need some sort of VBA code/macro to select dates based on current day of the report.
-Example: today is 8/13. I need the report to show the previous two days (8/11 and 8/12.)
-Tomorrow will need to show 8/11, 8/12 and so forth. Come the following Monday the whole process will be reset.
Something like this:
If weekday(Date) = 3 then
PivotDate between Date()-2 and Date()-1
Just do not know how to translate that into VBA.
Bookmarks