Macro to return all matches from a list and populate sheet

davio565

New Member
Joined
Jan 19, 2017
Messages
23
Hi Guys,

I'm having trouble with getting this one to work so turning to the experts.

So I have a list of data which is big (~300k rows and 15 columns). I have another list of names which is about 500 long.

So say the data is in Sheet 2 and my 500 names in Sheet 1, down column A.

I am wanting a macro to search through the data for each name and return the data from columns D to I from each row that matches. Perhaps for the most recent 20 matches (data is from old to new so the macro would work upwards).

Results would returned to sheet 1 to the right of the name. B1 to G1 would be filled with the first matched names data. H1 to M1 would be the second matched names data etc. This then the same for the name in A2, A3 etc.

I realise this may take a little time to execute but would anyone have any ideas?

I have found some code which does what i want however each name would need putting into the code which isn't feasible when there are 500 names and they change daily.

Any help much appreciated.

Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi there. You say:
each name would need putting into the code
but if youve found code that does what you want, why not just load the names into it from Sheet1?
 
Upvote 0
Hi there,

As i mentioned this is a list of 500 names that changes daily so changing these in the macro everyday sort of defeats the purpose of automating the solution.
 
Upvote 0
You did not understant what @jmacleary is saying

You said you have working code - so it could be modified to loop through the values in sheet 1

So either do that yourself or post that code if you require help
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top