Sub 删除() Application.ScreenUpdating = False Dim x%, y%, rng As Range x = Range("A65536").End(xlUp).Row For y = x To 1 Step -1 If Cells(y, 1) = "" Then Cells(y, 1).EntireRow.Delete Else Set rng = Range("A1:A" & x).Find(Cells(y, 1), LOOKAT:=1) If Not rng Is Nothing Then If rng.Row <> y Then Cells(y, 1).EntireRow.Delete End If End If End If Next y Application.ScreenUpdating = True End Sub
Sub yy() Dim d As Object, c As Range Set d = CreateObject("Scripting.Dictionary") For Each c In Range([a1], [a65536].End(3)) If Not d.exists(c.Value) Then d(c.Value) = "" Else c = "" End If Next [a:a].SpecialCells(4).Delete (3) End Sub
Sub 删除() Application.ScreenUpdating = False Dim x%, y%, rng As Range x = Range("A65536").End(xlUp).Row For y = x To 1 Step -1 If Cells(y, 1) = "" Then Cells(y, 1).EntireRow.Delete Else Set rng = Range("A1:A" & x).Find(Cells(y, 1), LOOKAT:=1) If Not rng Is Nothing Then If rng.Row <> y Then Cells(y, 1).EntireRow.Delete End If End If End If Next y Application.ScreenUpdating = True End Sub