Eliminate Duplicate Info in two columns (But not able to use "remove duplicates" - that I know of)

allstarrunner

New Member
Joined
May 29, 2012
Messages
34
Hi, and thanks in advance for your help. I want to compare two columns' data and put something in the third column when there is a change; or, eliminate the duplicate info alltogether.
For Example:

Code:
[TABLE="width: 164"]
<TBODY>[TR]
[TD]Cust Num</SPAN>
[/TD]
[TD]Contract Date</SPAN>
[/TD]
[/TR]
[TR]
[TD]0010000004</SPAN>
[/TD]
[TD="align: right"]1-Jan-10</SPAN>
[/TD]
[/TR]
[TR]
[TD]0010000004</SPAN>
[/TD]
[TD="align: right"]1-Jan-10</SPAN>
[/TD]
[/TR]
[TR]
[TD]0010000004</SPAN>
[/TD]
[TD="align: right"]1-Jan-10</SPAN>
[/TD]
[/TR]
[TR]
[TD]0010000009</SPAN>
[/TD]
[TD="align: right"]26-Oct-92</SPAN>
[/TD]
[/TR]
[TR]
[TD]0010000010</SPAN>
[/TD]
[TD="align: right"]1-Jan-10</SPAN>
[/TD]
[/TR]
</TBODY>[/TABLE]

If I use the excel fuction of "remove duplicates" in the first column (A) and the second column (B) then it will remove "1-Jan-10" from the last row, and I will end up with unequal amounts of data in the two columns (Cust Num "0010000010</SPAN>" would be present in Col A, but the date would be gone because "1 Jan 10" was already present) . So, in the above example, what I would want to see at the end is:

Code:
[TABLE="width: 164"]
<TBODY>[TR]
[TD]Cust Num</SPAN>
[/TD]
[TD]Contract Date</SPAN>
[/TD]
[/TR]
[TR]
[TD]0010000004</SPAN>
[/TD]
[TD="align: right"]1-Jan-10</SPAN>
[/TD]
[/TR]
[TR]
[TD]0010000009</SPAN>
[/TD]
[TD="align: right"]26-Oct-92</SPAN>
[/TD]
[/TR]
[TR]
[TD]0010000010</SPAN>
[/TD]
[TD="align: right"]1-Jan-10</SPAN>
[/TD]
[/TR]
</TBODY>[/TABLE]

What would be excellent, at least in my mind, (but I'm not smart enough to do it!) would be to have VBA look at row 1 and ask, "does A1 = A2 and does B1 = B2"? Yes, then lets delete row 2 because it is duplicate date. Then it looks at Row 2 (used to be row 3) and asks the same thing...No, A1 and A2 are different so lets go to Row 3 and compare it to Row2 and so on....
There could be a much easier way to do this...I'm just not sure! Thanks!!!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,215,473
Messages
6,125,022
Members
449,203
Latest member
tungnmqn90

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