|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- With ThisWorkbook.Sheets("主营业务利润表")
- For x = 3 To 14
- s = .Cells(x, 1).Value
- If d1.exists(s) Then
- .Cells(x, 2) = d1(s)(0)
- .Cells(x, 3) = d1(s)(1)
- .Cells(x, 4) = d1(s)(2)
- End If
- Next
- .[b15].Resize(1, 3).FormulaR1C1 = "=SUM(R3C:R[-1]C)"
-
- For x = 20 To 31
- s = .Cells(x, 1).Value
- If d2.exists(s) Then
- .Cells(x, 2) = d2(s)(0)
- .Cells(x, 3) = d2(s)(1)
- .Cells(x, 4) = d2(s)(2)
- End If
-
- If d3.exists(s) Then
- .Cells(x, 7) = d3(s)
- End If
- Next
- .[b32].Resize(1, 7).FormulaR1C1 = "=SUM(R20C:R[-1]C)"
- End With
- MsgBox "ok!"
复制代码
|
|