View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
edward edward is offline
external usenet poster
 
Posts: 87
Default Need Help Matching 2 Lists of data

You need two nested loops ,but if you first sort your data (both worksheets
) and exit the inner loop when there is a change for example in SKU then you
can increase the efficiency of your code . According to your description it
seems one important field is missing from your data which helps to
distinguish between orders with same SKU,Account,Price . something like an
order number
--
Best regards,
Edward


"James" wrote:

I have 2 lists of data from 2 different sources located in two different
worksheets. I need to reconcile the two lists and copy discrepancies to a
third worksheet. Both of the lists should contain the same data and format.

Worksheet 1 - Ordered
Item, SKU, Account, Price, and Quantity

Worksheet 2 - Received
Item, SKU, Account, Price, and Quantity

I need to match on Item, SKU, Account, and Price and look for discrepancies
in the Quantity of the item ordered. I have an idea of how to write such a
function in VBA but it involves, searching through List 1 one item at a time
to match to List 2. Is there a more efficient way to write VBA for this task?

Thanks for your help!