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:
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:
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!!!
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!!!