ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to build a dynamic array and search it for a value (https://www.excelbanter.com/excel-programming/428304-how-build-dynamic-array-search-value.html)

michael.beckinsale

how to build a dynamic array and search it for a value
 
Hi All,

What l want to do is to copy rows from 'source' workbooks and append
to a 'master' workbook but only rows where the unique reference does
not already exist in the 'master' workbook. The source & master
workbooks are identical in layout and the unique identifier is in
column A.

I have used the code generously given by Ron De Bruin to loop through
all the source workbooks and all works fine but l am stumped as to the
best way to achieve the above efficiently without going down the
Access / SQL route.

My thoughts were to build an array from column A of the 'master'
workbook and then loop through each row of column A of the 'source'
workbook copying the data if the cell(r,"A").Value was in the array.

Can anybody point me in the right direction with some sample code to:

1) Build the 'master' workbook array
2) Check that the current 'source' record idnetifier exists in the
array

Alternatively suggest a better / quicker method with some example
code. There is likely to be approx 12 workbooks with 300 rows /
records in each. VBA code needs to be compatible with XL2003 & XL2007.

TIA

All help suggestions greatly appreciated.

Regards

Michael


Bernd P

how to build a dynamic array and search it for a value
 
Hello Michael,

Maybe my UDF's at
http://www.sulprobil.com/html/listfreq.html
can help you. Lfreq, for example.

Regards,
Bernd


All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com