Hi all. I'm pretty new to VBA and macros and have been muddling through, but have arrived at a problem I can't solve and I'd really appreciate any advice or help that can be given :-)
I've got a Sheet with 70,000 customer transactions, and another Sheet in the same Workbook with details about 20,000 customers. I'm trying to add so code to a macro that will go through each of the 70,000 transactions and pull in some info from the relevant line out of the 20,000 customers. I managed to do this with some loops when the data set was MUCH smaller, but using the same process now seems to be making Excel crash - either that or I've not been patient enough to leave it running long enough. Either way, it needs some improvement!!
A much smaller version of the file is attached to this post, confidential data removed.
The way my loop was working was to compare the "Customer Number" in the "Distributor Sales" sheet with the "Customer Number" in the "Customer Countries" sheet, and pull out the "Country", "Customer Name" and "Type" back into the "Distributor Sales" sheet. I'd been using these loops:
Is there a better way to do this without the repeating loops? Perhaps by making the reference data in the "Customer Countries" into an array, or a scripting dictionary? Thanks in advance!!
Bookmarks