|
Sub 按钮1_Click()
Set d = CreateObject("scripting.dictionary")
Set d = CreateObject("scripting.dictionary")
r = Cells(Rows.Count, 2).End(3).Row
arr = [b1].Resize(r, 2)
For j = 1 To UBound(arr)
l2:
brr = Split(arr(j, 1), ",")
str1 = ""
For i = 1 To Val(arr(j, 2))
l1:
x = WorksheetFunction.RandBetween(0, UBound(brr))
If brr(x) = "" Then GoTo l1
str1 = str1 & "," & brr(x)
brr(x) = ""
Next i
str2 = Join(brr, ",")
If d.exists(str2) Then GoTo l2
arr(j, 1) = "'" & Mid(str1, 2)
str2 = ""
For Each x In brr
If Len(x) > 0 Then
str2 = str2 & "," & x
End If
Next x
arr(j, 2) = "'" & Mid(str2, 2)
Next j
[d1].Resize(r, 2) = arr
End Sub
|
评分
-
1
查看全部评分
-
|