• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

makro to find duplicate rows and delete when = 1

mokie

New Member
Hi All,
I will be really appreciate for your help.
It will be very helpful to do it by macro.

I' d like to find duplicate rows (conditions on column A,B together)
compare it and delete entire row
when on (Col G) is value = 1.
when on (Col G) is value = 2 do nothing.


I have attached a simple workbook on this.
Thanks, in advance.
 

Attachments

  • delete_duplicate.xlsx
    12.8 KB · Views: 3
@mokie
Why rows 11 & 12 are marked with '2'?
Only rows 5-9 and 6-10 are duplicate rows.
This sample will delete only rows 5 & 6.
Did You mean that there should be left only original rows 9 & 10?
If so, this need minor modification...

press [Delete Duplicates] to run ...
 

Attachments

  • delete_duplicate.xlsb
    22.9 KB · Views: 9
Hello,
vletm

"2" is mean that is fresh data.
However for any condition I already tested Your solution It's works exactly how I imagine it every time.


Thank You so much &
Marry Christmas:)
 
Vletm
If I undersood this line means that
the loop start from line 3 to last row.
Code:
For y = 3 To y_max - 1

How to modificate it to checking only last 20 rows in table.
(in examle loop start from 3 to 35 row)

Thanks, in advance.
 
Back
Top