VBA Looping Data n' Deleting Duplicates

Pinaceous

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

I have three separate data tables, where I'd like to loop values for specific row values for columns G & I and delete its duplicate.

Where;

Data 1: is between Rows (2-172)

Data 2: is between Rows (173-273)

Data 3: is between Rows (274-573)


Here;

Data 1 - This is the 2nd place where the loop goes and takes the values for Columns G & I.

Data 2 - This is the Last Place where the loop goes and takes the values for Columns G & I.

Data 3 - This is the First Place where the loop begins and takes the values for Columns G & I.



Example:


So if all three duplicates are present;

Data 1:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Column C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]XY 155
[/TD]
[TD]WWW
[/TD]
[TD]XY
[/TD]
[TD]155
[/TD]
[TD]1659
[/TD]
[TD]WWW
[/TD]
[TD]259
[/TD]
[/TR]
</tbody>[/TABLE]


Data 2:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Column C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]XY 155
[/TD]
[TD]WWW
[/TD]
[TD]XY
[/TD]
[TD]155
[/TD]
[TD]1459
[/TD]
[TD]WWW
[/TD]
[TD]559
[/TD]
[/TR]
</tbody>[/TABLE]

Data 3:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Column C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]XY 155
[/TD]
[TD]WWW
[/TD]
[TD]XY
[/TD]
[TD]155
[/TD]
[TD]1759
[/TD]
[TD]WWW
[/TD]
[TD]359
[/TD]
[/TR]
</tbody>[/TABLE]


Where after deleting a duplicate it takes the values of Data 2 producing;

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Column C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]XY 155
[/TD]
[TD]WWW
[/TD]
[TD]XY
[/TD]
[TD]155
[/TD]
[TD]1459
[/TD]
[TD]WWW
[/TD]
[TD]559
[/TD]
[/TR]
</tbody>[/TABLE]


Let me know what you can come up with.

Thank you,
Pinaceous
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,222,142
Messages
6,164,169
Members
451,880
Latest member
2da

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