excel vba - For all unique cells in a row, delete rows -
i need delete rows cells in column "e" unique, have "non-unique" cells in column i.e column "e" has duplicates.
i have been searching code have found little.
sorry cant post snip-it start off with.
thanks
give try:
sub removeuniques() dim e range, rdel range, r range, n long n = cells(rows.count, "e").end(xlup).row set e = range("e1:e" & n) dim wf worksheetfunction set wf = application.worksheetfunction set rdel = nothing each r in e v = r.value if wf.countif(e, v) = 1 if rdel nothing set rdel = r else set rdel = union(rdel, r) end if end if next r if not rdel nothing rdel.entirerow.delete end if end sub
Comments
Post a Comment