Dynamically paste two tables in Excel with a macro
Hello and happy holidays! I'm making a macro to export some pivot tables from QlikView to Excel and at the moment I'm pasting them on excel ranges in a hard-coded trial-and-error manner. Is there any way to get the last row of a table you just pasted into Excel from QlikView, using VBA macros? I want to make the whole macro work more dynamically.
For example, assuming I have two tables(with ID "CH01"):
Employee_ID
Day
Hours worked
ChWb
28/10/2017
8
pOD7
15/10/2017
8
TBKs
22/11/2017
8
a6Ua
18/11/2017
8
35PP
02/12/2017
8
and(with ID "CH02")
Employee_ID
Hours worked/Month
ChWb
160
pOD7
160
TBKs
160
How should I write the VBA script so that the second table is pasted right below the first table, without hard-coding the range values?