Macro Modification.

Amorphous

New Member
Joined
Mar 10, 2011
Messages
1
Hello,
I want to compare two data in two column to find duplicates in excel. I found a macro that can help me to arrange some simple data sequence as pics below.

13786770.jpg


After running that macro, it will return result as below.

78471877.jpg


Matches data will shown at column B. My problem is, i want to add something that can filter my data. (I dont know how to say ). But i think those pics below can explain it for me .

40888396.jpg

My new data sequence [C] with additional characters at the end of original data.

23916606.jpg

So i want to add something that can matches 1st 10 characters and show it at column B by comparing with original data at column A.

This is the macro that i used btw.

Code:
Sub Find_Matches()
    Dim CompareRange As Variant, x As Variant, y As Variant
    Set CompareRange = Range("C1:C8")
    For Each x In Selection
        For Each y In CompareRange
            If x = y Then x.Offset(0, 1) = x
        Next y
    Next x
End Sub
Hope someone can help me out. Sorry for my bad english . Thanks in advance.
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

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