|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 汇总()
Application.ScreenUpdating = False
Dim ar As Variant
Dim i As Long, r As Long, rs As Long
Dim br()
Dim d As Object
Set d = CreateObject("scripting.dictionary")
With Sheets("sheet1")
r = .Cells(Rows.Count, 1).End(xlUp).Row
ar = .Range("a1:f" & r)
End With
ReDim br(1 To UBound(ar), 1 To 5)
For i = 3 To UBound(ar) Step 14
For s = i To i + 9
If ar(s, 1) <> "" Then
n = n + 1
br(n, 1) = n
For j = 2 To 4
br(n, j) = ar(s, j)
Next j
br(n, 5) = ar(s, j)
End If
Next s
Next i
With Sheets("汇总")
.[a1].CurrentRegion.Offset(1) = Empty
.[a2].Resize(n, UBound(br, 2)) = br
End With
Application.ScreenUpdating = True
MsgBox "ok!"
End Sub
|
|