|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。
- Sub ykcbf() '//2024.12.19
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- b = [{1,2,5,11,12,15,39,24,38,30,32,40}]
- With Sheets("台帐")
- r = .Cells(Rows.Count, 1).End(3).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c)
- End With
- With Sheets("2025")
- .UsedRange.Offset(2).ClearContents
- ReDim brr(1 To 10000, 1 To 12)
- For i = 6 To UBound(arr)
- If Val(arr(i, 1)) Then
- m = m + 1
- brr(m, 1) = m
- For x = 2 To UBound(b)
- brr(m, x) = arr(i, b(x))
- Next
- End If
- Next
- .[a3].Resize(m, 12) = brr
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|