1. I have a sample dataset attached with 3 columns - Plants, Date and Sales
2. There is a pivot table created that filters on Plant and Date
3. The user will specify the plant name and the start and end date
4. The pivot table will be filtered for that specific plant and the time interval between the start and end date as seen in the image attached
5. The user will have the option to select TWO plants. In the attached image we have Plant B in Cell J5 but the user has the option to also write Plant A in K5. So the code must be flexible if either one plant or two plants have been selected.
6. The max and min date automatically checks to ensure the start and end date is within bounds
All of this needs to be in a VBA script.
This is just one tab but in the file there will be atleast 10 tabs with 2 Pivot tables each. So the vba script must include a function that does all the tasks and at the very least take the pivot table as its argument.
Help - Does anyone have any advice/code that can do this? I have spent days trying to build this and looking online and theres always some kind of constraint. Thanks in advance!
Bookmarks