Remove Duplicates in Keeping the Values from the Deleted Row's Duplicate

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
1,124
Office Version
  1. 365
Platform
  1. Windows
Hi All,

In using Excell 2013 ->

Here is my Data:


[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]
[TABLE="class: MsoNormalTable, width: 508"]
<tbody>[TR]
[TD="bgcolor: transparent"]Representing Data From:<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]Column C<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]D<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]E<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]F<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]G<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]H<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]I<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]J<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]K<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]L<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]M<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]N<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]O<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]P<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]Q<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]R<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]S<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]T<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]U<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]V<o:p></o:p>
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Rows.2-172<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]XY155<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]ABC<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]XY<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]155<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]1559<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]ABC<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]330<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]1<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]2<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]3<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]4<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]5<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]6<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]7<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]8<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]9<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]10<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]11<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]12<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]13<o:p></o:p>
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Rows.173-372<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]XY155<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]XY<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]155<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]1645<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]ABC<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]250<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Rows.373-573<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]XY155<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"]XY<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]155<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]1559<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]ABC<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]330<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]



I have three sets of data that appear in specific rows.

Where,

The first set of data is located in the rows range of 2-172.
The second set of data is located in the rows range of 173-372.
The third set of data is located in the rows range of 373-573.

What I want by VBA Code is to 'Delete the Duplicates' in using a 'Common Qualifier' found in Column C in keeping the ‘Numerical/Alphanumeric Values' for the deleted rows duplicates of which specifically takes the values for Columns G & I because it is from the 2nd’s set of data.

So then the Data Result after Macro execution; will result in the following table:

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]
[TABLE="class: MsoNormalTable, width: 508"]
<tbody>[TR]
[TD="bgcolor: transparent"]Representing:<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]Column C<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]D<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]E<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]F<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]G<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]H<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]I<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]J<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]K<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]L<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]M<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]N<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]O<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]P<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]Q<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]R<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]S<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]T<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]U<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]V<o:p></o:p>
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Result of Code: now populated in Rows.2-172<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]XY155<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]ABC<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]XY<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]159<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]1645<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]ABC<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]250<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]1<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]2<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]3<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]4<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]5<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]6<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]7<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]8<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]9<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]10<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]11<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]12<o:p></o:p>
[/TD]
[TD="bgcolor: transparent"]13<o:p></o:p>
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]


Where you can see that the 2nd’s set of data for Columns G & I values were taken in the result.

It seems like such a simple concept, I'll really appreciate your input on this one.

Please Help!
R/
-Pin
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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