vba code to find duplicates in two lists

helpsky

New Member
Joined
May 13, 2018
Messages
7
hi!

i have two lists below, one is my inventory and one is what i want to match it against:

inventory list
TickerQuantityCounterparty
AAPL1A
AAPL2B
BABA1A
T3A
T4A
CIS3C
NFLX4G
NFLX4H
NFLX7G

<tbody>
</tbody>

match to:
TickerQuantity
AAPL3
AAPL2
AAPL1
T5
NFLX4
NFLX3

<tbody>
</tbody>


IM not sure if its possible to write a code for this but... i would like a way to see the duplicate value on the two lists under the ticker columns, meaning if the inventory list has AAPL and the match list has AAPL then AAPL will end u in the result column BUT it will end up there the exact amount of times that it appears on each list so AAPL is on the first list twice and on the second list 2 times so it comes up twice under matches in results and 3 times under needed in the results. the only criteria that needs to be matches is the tickers but i am having difficulty finding ways to align the quantity and counterparty since the amounts can differ on each list. please let me know if you can help with a code for this or a better way. thank you!!!


RESULT:
MatchesQuantityCounterpartyNeededQuantity
AAPL1AAAPL3
AAPL2BAAPL2
AAPL1
T3AT5
T4A
NFLX4GNFLX4
NFLX4HNFLX3
NFLX7G

<tbody>
</tbody>
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,215,823
Messages
6,127,071
Members
449,358
Latest member
Snowinx

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