I have the below code which essentially loops through each row of data in a Pivot Table and inputs the data into a List Object Table. The issue I have with it is that only half of the formula is dynamic to some extend. Where the data goes is fine as it references the table name and the column numbers, however where the data comes from is not. It currently references columns G and H which isn't idea as if others add columns then the macro would no longer work.
How do I reference the Pivot Tables themselves to get the data rather than the columns they are currently placed in? I have attached pictures of the Pivot Table where the data is to come from and the List Object where the data is to feed into.
Bookmarks