'自定义公式-按ALT+F11-插入模块-粘贴代码-将表格另存为启用宏的格式Function 去重显示次数(a As Range, c As String, d As String)For Each cel In a b = b & " " & celNextArr = Split(Mid(b, 2), " ")Set dic = CreateObject("dictionary")For i = 0 To UBound(Arr) dic(Arr(i)) = dic(Arr(i)) + 1Next n = keys m = ItemsIf c = 1 Then 去重显示次数 = n(d - 1)Else 去重显示次数 = m(d - 1)End IfEnd Function