|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub huizong()
- Dim h&, i&, j&, k&, st$, sk$, da As Date
- Dim ra As Range, arr, brr, xx, yy
- Dim ws As Worksheet
- For Each ws In Worksheets
- If ws.Name <> "汇总表" Then
- st = ws.Range("d2")
- da = ws.Range("o2")
- sk = ws.Range("n17")
- arr = ws.Range("b4:t15")
- ReDim brr(1 To 1000, 1 To 7)
- For i = 1 To UBound(arr)
- If arr(i, 1) <> "" Then
- brr(i, 1) = st
- brr(i, 2) = da
- brr(i, 3) = arr(i, 1)
- brr(i, 4) = arr(i, 4)
- brr(i, 5) = arr(i, 15)
- brr(i, 6) = arr(i, 17)
- brr(i, 7) = sk
- Else
- Exit For
- End If
- Next
- Else
- Exit For
- End If
- h = Sheets("汇总表").Cells(Rows.Count, 2).End(3).Row + 1
- Sheets("汇总表").Range("b" & h).Resize(UBound(brr), 7) = brr
- Next
- End Sub
复制代码 |
|