数据排列删选
怎么把像这样的 数据1+22+11+2+32+1+33+2+1筛选出只得一个数据多余排列的不要 得1+21+2+3 坛友您好~!为了问题更快更好的得到解决,并且节省帮助您的坛友的时间~!
请说明问题,模拟结果,并上传压缩附件~!
请阅读:
EXCEL函数与公式版:新人必读之发贴要素
Option Explicit
Sub test()
Dim arr, i, j, k, s, t, m, dic
Set dic = CreateObject("scripting.dictionary")
arr = .CurrentRegion.Value
For i = 1 To UBound(arr, 1)
t = Split(arr(i, 1), "+")
For j = 0 To UBound(t) - 1
For k = j + 1 To UBound(t)
If t(j) > t(k) Then
s = t(j): t(j) = t(k): t(k) = s
End If
Next
Next
t = Join(t, "+")
If Not dic.exists(t) Then
m = m + 1: dic(t) = 1
arr(m, 1) = t
End If
Next
.Resize(m) = arr
End Sub 谢谢
页:
[1]