|
Sub shishi()
Dim cx As New 类1, pt$, sql$
Application.ScreenUpdating = False
t = Array("PO1", "PO2", "PO3", "PO4")
pt = ThisWorkbook.FullName
For i = 0 To UBound(t)
sql = "select PO代码, PO订单, 区域 , 订单名称, 订单金额, 合同名称 from [订单明细$a1:g] where PO代码 = '" & t(i) & "'"
Sheets(i + 2).Activate: Range("a1", Cells(1000, "e")).ClearContents
[a1:e1] = Array("PO代码", "PO订单", "区域", "订单名称", "订单金额", "合同名称")
cx.执行sql命令 pt, sql, "a2"
Next
Sheet2.Activate
Application.ScreenUpdating = True
MsgBox "提取完成,请核对!"
End Sub
需要对订单金额进行汇总,po1\po2\po3\po4这四个表中的订单金额列进行求和汇总;请大神赐教!帮帮忙
|
|