|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 按钮1_Click()
Set d = CreateObject("scripting.dictionary")
r = Cells(Rows.Count, 1).End(3).Row
arr = [a1].Resize(r, 5)
r = 2
For j = 2 To UBound(arr)
If Len(arr(j, 1)) > 0 Then
d(arr(j, 1)) = d(arr(j, 1)) & "," & j
End If
Next j
Application.ScreenUpdating = False
For Each kk In d.keys
brr = Split(d(kk), ",")
For j = 1 To UBound(brr) Step 10
For i = 0 To 9
If j + i <= UBound(brr) Then
For k = 1 To 5
Cells(r + i, k + 6) = arr(Val(brr(j + i)), k)
Next k
End If
Next i
r = r + 10
Next j
Next kk
Application.ScreenUpdating = True
End Sub
|
|