|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。
- Sub ykcbf() '//2024.5.6
- Application.ScreenUpdating = False
- Set ws = ThisWorkbook
- Set sh = ThisWorkbook.Sheets("总表")
- p = ws.Path
- f = p & "\收入.xlsx"
- Set wb = Workbooks.Open(f, 0)
- ReDim brr(1 To 1, 1 To 12)
- On Error Resume Next
- With wb.Sheets("Dash_OOH")
- r = 32: c = 0
- For j = 14 To 28
- If InStr(.Cells(5, j), "月") Then
- c = c + 1
- If c = 1 Then
- brr(1, 1) = .Cells(r, 14)
- Else
- brr(1, c) = brr(1, c - 1) + .Cells(r, j)
- End If
- End If
- Next
- End With
- wb.Close False
- sh.Cells(24, "N").Resize(1, 12) = brr
- f = p & "\其他费用.xlsx"
- Set wb = Workbooks.Open(f, 0)
- With wb.Sheets(1)
- .[c3:n7].Copy sh.[n35]
- .[c14:n17].Copy sh.[n54]
- End With
- wb.Close False
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|