I have a pivot table in columns A-C. The macro is already refreshing the pivot table in the code which changes the size of the pivot table.

I have a corresponding table next to the pivot table, starting in column E. I need the code to determine if the pivot table or regular table is longer. And then based upon that match the size of the table.

I was thinking the code could basically say if count of column A => column E "drag down"
else "drag up"

Then to execute the dragging, it would copy and paste the table's formulas down to the correct cell, by using offset somehow.
I just can't figure out exactly how to code it.

I appreciate any help!
Thank you =)