|
参与一下。。。
- Sub ykcbf() '//2024.6.26
- Dim arr, brr
- Application.ScreenUpdating = False
- Set ws = ThisWorkbook
- Set sh = ws.Sheets("统计表")
- With ws.Sheets("清单")
- arr = .UsedRange
- dw = .[c3].Value
- rq = .[h3].Value
- End With
- ReDim brr(1 To 100000, 1 To 100)
- For i = 5 To UBound(arr)
- If InStr(arr(i, 1), "金额合计") Then Exit For
- If arr(i, 2) <> Empty Then
- m = m + 1
- brr(m, 1) = m
- brr(m, 2) = dw
- brr(m, 3) = rq
- brr(m, 4) = arr(i, 2)
- For j = 4 To UBound(arr, 2)
- brr(m, j + 1) = arr(i, j)
- Next
- End If
- Next
- With sh
- .UsedRange.Offset(1).Clear
- With .[a2].Resize(m, 10)
- .Value = brr
- .Borders.LineStyle = 1
- .HorizontalAlignment = xlCenter
- .VerticalAlignment = xlCenter
- End With
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
2
查看全部评分
-
|