我的工作表中有24列和30行。如何检查某些输入是否存在多次以及如何使它们脱颖而出?
答案 0 :(得分:0)
如果您希望通过更改格式来简单地找到重复的单元格,请运行以下短宏:
Sub DuplicateFinder()
Dim r As Range, Mesage As String
Dim rBig As Range
ActiveSheet.UsedRange
Set rBig = ActiveSheet.UsedRange
Mesage = ""
For Each r In rBig
If r.Value <> "" Then
If Application.WorksheetFunction.CountIf(rBig, r) > 1 Then
Mesage = Mesage & vbCrLf & r.Address(0, 0)
End If
End If
Next r
If Mesage = "" Then
MsgBox "no duplicates"
Else
MsgBox Mesage
End If
End Sub