VBA- how to dynamically extract a list of values from a column range given a condition

salman94

New Member
Joined
Jun 7, 2018
Messages
21
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]FUND CODE[/TD]
[TD]FUND CODE[/TD]
[TD]DEALER CODE[/TD]
[TD]DEALER CODE[/TD]
[TD]DEALER CODE[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]AAA[/TD]
[TD]ABA[/TD]
[TD]123[/TD]
[TD]345[/TD]
[TD]678[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]BBB[/TD]
[TD]BAB[/TD]
[TD]987[/TD]
[TD]654[/TD]
[TD]321[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]CCC[/TD]
[TD]C123[/TD]
[TD]111[/TD]
[TD]222[/TD]
[TD]333[/TD]
[/TR]
</tbody>[/TABLE]

Above table is in "Fundata List" Tab:
[TABLE="width: 544"]
<tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Hi, I would like to write a macro that will extract all the dealer codes from a tab called "Positions" for fund codes in each row of a list in "Fundata List" tab. Then output the dealer codes in the "Fundata List" in columns D, E, F... and so on (without duplicates).

The "Positions" tab has all the various fund codes in column C and their respective dealer codes in column P. Once it extracts and outputs all the different Dealer Codes in columns D, E, F, G, etc, then I would like to remove duplicates so a dealer code doesn't appear twice for each respective fund codes row. I will greatly appreciate anyone that can figure this out. Thanks in advance![/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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