Deleting Duplicate Rows containing a value matching with a value f

  • Thread starter Thread starter emil
  • Start date Start date
E

emil

Delete Duplicate Rows containing more values matching with a value from a
cell located in other Range.
I searched the answer on Site http: Www. Cpearson.com Excel distinctvalues.
Aspx, as well as in another questions from this forum but I did not found the
answer.
Thanks for any helps
Emil
 
the key is how do you define a duplicate row?
i already answered a similar question.
my method was to add a key column which was the concatenated values of 10
columns. then we removed lines where we had duplicate keys.

think on this approach
 
Hello
Patrick Molloy

Thank very much for your answer.
Delete Duplicate Rows
I believe that my question was not clear.
Here is an e.g.
I have a column (“F: Fâ€) with the values as strings:
Range (“F1â€).value = “Str1â€
Range (“F2â€).value = “Str1â€
Range (“F3â€).value = “Str1â€
Range (“F4â€).value = “Str1â€
Range (“F5â€).value = “Str2â€
Range (“F6â€).value = “Str3â€
Range (“F7â€).value = “Str3â€
Range (“F8â€).value = “Str3â€

- At the first running of procedure, Cell (“A1â€) has, the value “Str1â€, and
I will to erase the rows, which has the duplicates as “Str1†in column (“F:
Fâ€).
- At the second running of procedure, the value in Cell (“A1â€) changed to
“Str2â€. Because I have no duplicates in column (“F: Fâ€) for “Str2â€, do not
erased any rows.
- At the third running of procedure, the value in Cell (“A1â€) changed to
“Str3†and I will to erase the rows, which has the duplicates as “Str3†in
column (“F: Fâ€).
And so on, systematically.
How can I do this?
I thank once again for granted time!
Emil.
 
if the values in F are sorted, then starting at the bottom, ie the
highest/largest row number , if the data in the cell in the next lower row
matches , then delete the row


for rw = range("F1").End(xlDown).Row to 2 step -1
if cells(rw,"F")=cells(rw-1,"F") then
rows(rw),delete
end if
next
 
Back
Top