I combine several large ranges from multiple near identical sheets in multipe workbooks
- for speed this is done using arrays
- each sheet contains the same number of columns, but row numbers vary
- example below comprises only 2 ranges to keep things simple
- looping through individual values in each sheet in each workbook and placing them directly in final array is slower than what I do already
Assigning values to arrays from ranges is easy
a() = rngA.Value
b() = rngB.Value
To combine the arrays
- run through all the values in each array and place them in the 3rd array before printing that to worksheet
Q1 Is there a slicker way to get the values into the final array?Please Login or Register to view this content.
- is it possible to assign multiple ranges in multiple workbooks directly to the final array
- is there an equivalent of the UNION function to glue 2 or more arrays together
( using UNION with the ranges first cannot work because on different sheets and workbooks)
- I have found various complex functions out there that will get the job done - including this very compehensive page from cpearson
Q2 - is there a quicker way to assign the values from the final array directly to the worksheet?
(Instead of printing each item individually to the worksheet - see bottom of code below)
Thank you for spending time reading this
Full code - run in attached workbook with {CTRL} k
Please Login or Register to view this content.
Bookmarks