'需要点击菜单:工程->引用->MicrosoftScriptingRuntime
Public Function HasRepeat(ByRef arr() As String) As Boolean Dim dict As Dictionary Set dict = New Dictionary Dim i As Variant For Each i In arr If i <> "" Then If dict.Exists(i) Then HasRepeat = True Exit Function Else dict.Add i,0 End If End If Next HasRepeat = False End Function