Function mcqc(rng As Range)
Set d = CreateObject("Scripting.Dictionary")
For Each a In rng
d(a.Value) = ""
Next
mcqc = Join(d.keys, ";")
End Function
=MCQC(区域)
在B1列中生成一个数组?能办到吗。如果B1中得到图中一样的字符串倒是不难
Sub tests()
Dim rst As String
rst = "{" & Cells(1, 1) & ";"
i = 2
Do While Cells(i, 1) <> ""
If Len(rst) = Len(Replace(rst, Cells(i, 1), "")) Then
rst = rst & Cells(i, 1) & ";"
End If
i = i + 1
Loop
rst = Left(rst, Len(rst) - 1)
rst = rst & Cells(i, 1) & "}"
Cells(1, 2) = rst
End Sub