Filtering Unique records

chiswickbridge

Board Regular
Joined
Feb 2, 2013
Messages
127
My data is as follows...6 columns....Duplicate data in col A and col D....need to be attended to
AAAxxxyyyUSDzzzwwwAAAUSD
BBBabcsweINRwedfdeAAACAN
CCCCANAAAINR
DDDUSDBBBINR
EEEROUBBBSRT
BBBSRTCCCCAN
CCCMYNCCCMYN
AAACANDDDUSD
AAAINRDDDINR
DDDINREEEROU

<tbody>
</tbody>

Since the data set runs in 50,000 rows, I need a VBA to select Unique records of A and paste them in Col I and the corresponding unique records from Col D pasted in Col J.
AAA - has 3 unique records
BBB - has 2 unique records
CCC - has 2 unique records

Thanks.....
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Try:

Code:
Sub Macro()
    Range("A:A,D:D").Copy Range("I1")
    u = Range("I" & Rows.Count).End(xlUp).Row
    ActiveSheet.Range("I1:J" & u).RemoveDuplicates Columns:=Array(1, 2), Header:=xlNo
End Sub
 
Upvote 0
Thank You....Dante....What more can I say.....Lovely VBA in a short script.....FANTASTIC

Any tips on which book to use for VBA learning....or is it hands-on ?.....Would love to be like you...
 
Upvote 0
Hi Dante.....What changes do I need to do... if I plan to startsaving my data from A10 to M10

I intend leaving the top 9 rows for placing icons and some cells for tabulations...
 
Upvote 0
Try:

Code:
Sub Macro()
    u = Range("A" & Rows.Count).End(xlUp).Row
    Range("A10:A" & u & ",D10:D" & u).Copy Range("I10")
    u = Range("I" & Rows.Count).End(xlUp).Row
    ActiveSheet.Range("I10:J" & u).RemoveDuplicates Columns:=Array(1, 2), Header:=xlNo
End Sub
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

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