Hi Peter
Apologies if I was unclear - I am new to VBA.
The data that is in the Results sheet contains all possible customer ID numbers. So, if you look for 23 in the Results sheet, you will find that one and only one row has customer 23 in it. However, if you look for customer 23 in the Original sheet, you will find there is more than one row which has customer 23 in it.
Both the Original sheet and the Results sheet have more information as well, though I do not think this has any bearing on the code.
For your reference, the additional information in the Results sheet are: value of debt, amount collected, amount outstanding, debtor open/closed, reopen file (on a date), additional comments.
The information that is contained in the Original sheet is: Customer ID, Comment date, Comment
Regarding your query about:
- Customer numbers and some 'Date - Comment' entries?
If so should the new 'Date - Comment' data be appended to existing data or replace it?
The way I have my data organised is that in the Original sheet, as discussed above, the columns I have are Customer ID, Comment date, Comment. I add rows to the data as more information comes through (i.e. there will be numerous entries for customer 23, but they will be randomly dispersed amongst other customers)(and also this means that the newest comment is added to the bottom of the data). So, if on 28/4/11 I input something for customer 23, and I also input something for customer 87, I will have two rows. I can also on 30/4/11 input some more data for customer 23, however this will be in a new row. So to answer your question above, it does not replace the data, but adds to it. This also should answer your question regarding what it is I mean about "...has a few different data sets" i.e. customer 23 will have different comments being inputted at different dates.
What I am aiming to achieve is for the Results sheet to look at what customer number I have in A4, then A5, then A6 all the way down to A99999. (NB: there will only be one unique Customer in A4:A99999 of the Results sheet). Then, once the computer has seen what customer number is in A4 of the Results sheet, I want the computer to look in cells A4:A99999 of the Original sheet and then bring back all the merged data and put it in cell M4 of the Results sheet.
For instance, if cell A4 of the Results sheet has Customer 23, I want the computer to look in cells A4:A99999 of the Original sheet and see when there is a Customer 23. If for instance:
cell A8 has Customer 23, cell B8 has 5/5/11, cell C8 has Comment 1
cell A24 has Customer 23, cell B24 has 7/7/11, cell C24 has Comment 2
cell A37 has Customer 23, cell B37 has 9/9/11, cell C37 has Comment 3
then I would like the computer to put in cell M4 of the Results sheet:
5/5/11 - Comment 1
7/7/11 - Comment 2
9/9/11 - Comment 3
I hope this is all clear now and I apologise for not being clearer at first instance.
Once again, I really appreciate the assistance you are providing!
Regards,
Jonathan