countryfan_nt
Well-known Member
- Joined
- May 19, 2004
- Messages
- 765
Hello friends, hope all is well!
The below code uses a SQL code to combine multi sheets (workbooks) into 1.
because there are many rows it is expected to take time, that is OK. The process is done. Now, I want to add on a different date a new sheet,
let us say F:\DATABASES\AvgClaimCo\14.xlsb`.[JAN-APR$]
Can somebody please help, and tell me how can I add the above sheet to the existing already added sheets from a previous period.
instead of redoing the UNION ALL All over again of 2015,2016,2017,2018?
This will save loads of time, and effort. Thanks a lot in advance!
The below code uses a SQL code to combine multi sheets (workbooks) into 1.
because there are many rows it is expected to take time, that is OK. The process is done. Now, I want to add on a different date a new sheet,
let us say F:\DATABASES\AvgClaimCo\14.xlsb`.[JAN-APR$]
Can somebody please help, and tell me how can I add the above sheet to the existing already added sheets from a previous period.
instead of redoing the UNION ALL All over again of 2015,2016,2017,2018?
This will save loads of time, and effort. Thanks a lot in advance!
Code:
SELECT [HEAD$].* FROM [HEAD$]
UNION ALL
SELECT * FROM `F:\DATABASES\AvgClaimCo\17-18.xlsb`.[JAN-APR$]
UNION ALL
SELECT * FROM `F:\DATABASES\AvgClaimCo\17-18.xlsb`.[MAY-AUG$]
UNION ALL
SELECT * FROM `F:\DATABASES\AvgClaimCo\17-18.xlsb`.[SEP-DEC$]
UNION ALL
SELECT * FROM `F:\DATABASES\AvgClaimCo\16.xlsb`.[JAN-MAR$]
UNION ALL
SELECT * FROM `F:\DATABASES\AvgClaimCo\16.xlsb`.[APR-SEP$]
UNION ALL
SELECT * FROM `F:\DATABASES\AvgClaimCo\16.xlsb`.[OCT-DEC$]
UNION ALL
SELECT * FROM `F:\DATABASES\AvgClaimCo\15.xlsb`.[Jan-Mar$]
UNION ALL
SELECT * FROM `F:\DATABASES\AvgClaimCo\15.xlsb`.[Apr-Jun$]
UNION ALL
SELECT * FROM `F:\DATABASES\AvgClaimCo\15.xlsb`.[Jul-Sep$]
UNION ALL
SELECT * FROM `F:\DATABASES\AvgClaimCo\15.xlsb`.[Oct-Dec$]