Find and return multiple value from a worksheet to another worksheet and move to next search criteria

priisha

New Member
Joined
Apr 4, 2022
Messages
22
Office Version
  1. 2016
Platform
  1. Windows
Hi,
I've been trying to find a way to look up a value from a list and return all entries from another worksheet, and when it's found it will move to another search criteria and repeat the same. Tried to use the index - array and small function but it will only return the first search criteria.

Tried to look for a VBA code but couldnt find one that matches what I'm looking for.

I have two worksheets
1) Result
2) Data (more than 50000 entries)

In the worksheet Result in column V I have search entries that I want to lookup, in column W I can see how many times this entry have been repeated in the worksheet Data
What I want the VBA to do is to look up the search criteria in column V (i.e cell V2) in worksheet Data and copy the enire row from column D in worksheet Data to the worksheet Result starting from A2 and repeat until all entries are found. When this is done the VBA will look up the entries for the next search criteria in column V (i.e cell V3) and continue until as long as value in column V>0 (because the value in column V is formula)
Result.png


result1.png


If the VBA works correctly the result should look like this

solution.png


Many thanks in advance for the help!
 

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.

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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