I feel like this should be pretty straightforward, so I don't know what I'm missing here. All I'm trying to do is rather than explicitly stating:
Code:
.CreatePivotTable TableDestination:="Worksheet!R1C1",
I want it to be dynamic, something like:
Code:
LastRow = Range("A" & Rows.Count).End(xlUp).Row
.CreatePivotTable TableDestination:=Range("A" & LastRow + 1),
The reason why is because I'm creating up to 15 pivot tables, but some of them might not exist on some reporting days. So rather than having large gaps on the worksheet (such as defining 15 hardcoded spots for each pivot and only 8 of them populate), I want to dynamically fill in the pivot tables 1 row beneath the previous one going down column A.
Is this doable? It's like I'm halfway there, but the error is stating that a pivot table cannot overlap another pivot, so perhaps it isn't returning the correct LastRow?