• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Return Multiple values matching the criterion in column

Hi All

I am working with 2 million rows and come across a macro for fast lookup which states about Scripting Dictionary object. As i tried to use it, it worked tremendously fast but the issue is when it matches the value in Col A from sheet 1 and searches in master data in Sheet 2, it gives single match and that too from bottom of the list. The result I get is in Sheet 1 with headers highlighted as Blue, however the desired one is highlighted as yellow. I am not at all able to tweak and hence looking forward. File is attached herewith for perusal...Regards
 

Attachments

  • lookupvalues.xlsm
    506.6 KB · Views: 8
amit_gupta123
Your sample data is ... short
but
Could You do it 'opposite' way?
Here two versions
a) 'ALL' shows ALL from Sheet2
b) 'Named' show those from Sheet1
 

Attachments

  • lookupvalues.xlsb
    259.7 KB · Views: 4
Dear Vletm...appreciate your response

Please note the following :

1. Looking for results for search list mentioned in sheet 1 out of master data in sheet 2. Sheet 1 might contain 1 lakh records and master is comprising of 20 lakh rows data

2. In the file attached by me, macro is working very fast and giving output quickly but the only challenge is for record having multiple matches are not appearing horizontally

3. It would be great if you have a look t code mentioned in my file and do some magic
 
Hi.​
2. So I suspect a bad Dictionary use which stores only the last value rather than all values, check the logic …​
 
amit_gupta123
as I wrote - Your sample data is ... short.
You seems not even tested those two versions ....
Your notes:
1) You're looking for results ... so? ... both of those would give result.
2) ... then Your macro do not give ... expected results.
3) I looked ... and that's why I tried to offer something which works.
 
Back
Top