I am working on an automated report by writing macros. A sample of my code is below.

Please Login or Register  to view this content.
I am aware that I have not closed the "For" and "Sub" above (this is just some of the code). As you may see, what I want to do is create a pivot table through each loop iteration (eventually, I wish to have 3 pivot tables per iteration). Currently, I get an error in the last line because the Pivot Table has not been named (I can't do numbers because the number of tables will vary).

So I ask, is there a way to have the OLAP Pivot Table only "focus" on the one that was just created?