Sub cc()
[d1:d50].Clear
a = [a1].CurrentRegion.Rows.Count
p = 0
q = 1
Cells(1, 4) = [a1].Value
For i = 1 To a
b = [d1].CurrentRegion.Rows.Count
n = 0
For j = 1 To b
If Cells(i, 1) <> Cells(j, 4) Then
n = n + 1
End If
If n >= b Then
Cells(b + 1, 4) = Cells(i, 1)
End If
Next
Next
For i = 1 To a
For j = 1 To a
If Cells(q, 4) = Cells(j, 1) Then
p = p + 1
End If
Next
If p >= 2 Then
q = q + 1
Else
Cells(q, 4).Delete Shift:=xlUp
End If
p = 0
Next
End Sub
@hgd1338 这样应该可以了,多加了一步判断