How to look for repeated rows and then delete one of them? requires VBA

前端 未结 5 2081
日久生厌
日久生厌 2020-12-12 00:05

I was wondering if anyone knows how to delete repeated rows.. Say for example,

   A        B       C

1  1        3       4
2  2        6       9
3  TEST            


        
5条回答
  •  一个人的身影
    2020-12-12 00:10

    Manual
    Bill Jelen's website offers three non-VBA techniques

    1. All Versions: Use the Unique Option in Advanced Filter
    2. Xl 07/10: Use Conditional Formatting to Mark Duplicates
    3. Xl 07/10: Use Remove Duplicates icon

    For (3) the equivalent VBA would be something like this (for no headers)
    ActiveSheet.Range("$A$1:$C$100").RemoveDuplicates Columns:=1, Header:=xlNo

    enter image description here

    Handling existing duplicates
    My free Duplicate Master addin will let you

    • Select
    • Colour
    • List
    • Delete

    duplicates on either cells, entire rows (which appears to be your question) or certain columns in a row

    But more importantly it will let you run more complex matching than exact strings, ie

    • Case Insensitive / Case Sensitive searches
    • Trim/Clean data
    • Remove all blank spaces (including CHAR(160))
    • Run regular expression matches
    • Match on any combination of columns (ie Column A, all columns, Column A&B etc) enter image description here

提交回复
热议问题