Excel 2003 Help: How to delete duplicates from specific colums and criteria

5 pts.
Tags:
Excel 2003 macros
Microsoft Excel 2003
Microsoft Excel 2003 macros
VBA
Visual Basic for Applications
Hi I have already sent my question here: http://www.vbforums.com/showthread.php?p=3477514#post3477514 But I will ask the same again: In my Excel file I have several columns and lots of rows. I want the macro to check the column named REF (let say it's in the B column). And it will check if other data contains the exact same characters/word. (this is a possible duplicate) If yes, then the next column to be checked is SEQ (let say it's in the column F). If other data contains the exact same characters/word. (this confirms that this is a duplicate, but no deletion yet, see below) Then the last column to be checked is STAT (let say it's in column K). Now here is where the deletion will take on. The criteria is: Example: Row 321 och 400 has the same REF and SEQ STAT for 321 is other than MAK and STAT for 400 is other than MAK, then only one of them should stay. STAT for 321 is MAK and STAT for 400 is other than MAK, then MAK should stay STAT for 321 is MAK and STAT for 400 is MAK, then only one of them should stay. How can I program this? Thanks in advance Best Regards Groom
ASKED: March 23, 2009  11:02 PM
UPDATED: March 24, 2009  2:37 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

How do you do this manually? Because that’s all a macro is.
Sounds like:
<ol>
<li>Add work column (let’s say M) with formula =B2=F2=K2 copied down to end.</li><li>Delete rows where M is TRUE.</li><li>Delete the work column</li>
</ol>
I’d generally do the deleting by converting the formula to value, replace FALSE with “” (clear the contents). Sort the column. Delete the rows that still have a value (“TRUE”). But I tend to do this the hard way.

Further improvements would be appreciated.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following