对于这种情况,我有这个子..
Sub CheckDupl()
Dim x, i, nD As Integer
Dim c As String
Dim nLimit As Integer
Dim bFound As Boolean
nLimit = 3 '--> you can change this
nD = 1
For x = 1 To 3
Cells(x, 6) = "x"
c = Cells(x, 3)
bFound = False
For n = x + 1 To nLimit
If Not Cells(n, 6) = "x" Then
If Cells(n, 3) = c Then
If Not bFound Then
bFound = True
Cells(nD, 4) = Cells(x, 3)
Cells(nD, 5) = Cells(x, 1)
MsgBox n
Cells(nD + 1, 4) = Cells(n, 3)
Cells(nD + 1, 5) = Cells(n, 1)
Cells(n, 6) = "x"
nD = nD + 2
Else
Cells(nD, 4) = Cells(n, 3)
Cells(nD, 5) = Cells(n, 1)
Cells(n, 6) = "x"
nD = nD + 1
End If
End If
End If
Next
Next
End Sub
您可以通过按钮激活.. F列用于帮助,您可以将其删除!