|
- Sub test()
- Dim d As Object
- Set d = CreateObject("Scripting.Dictionary")
- Dim i, j, k, l, m, n, s
- arr = Sheet1.Range("a1:h1")
- For i = 1 To UBound(arr, 2)
- For j = i + 1 To UBound(arr, 2)
- For k = j + 1 To UBound(arr, 2)
- For l = k + 1 To UBound(arr, 2)
- For m = l + 1 To UBound(arr, 2)
- n = arr(1, i) & "-" & arr(1, j) & "-" & arr(1, k) & "-" & arr(1, l) & "-" & arr(1, m)
- d.Add n, n
- Next
- Next
- Next
- Next
- Next
- Sheet2.[a1].Resize(d.Count, 1) = Application.Transpose(d.Keys)
- End Sub
复制代码 不过,太多数据的话,运行起来估计不太好~~~ |
|