|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub limonet()
Dim Cn As Object, StrSQL$
Set Cn = CreateObject("adodb.connection")
Cn.Open "provider=microsoft.ace.oledb.12.0;extended properties=excel 12.0;data source=" & ThisWorkbook.FullName
StrSQL = "select 发货日期,[称重/KG],物流方式 from [明细$A3:L] where year(发货日期)=" & [K2] & "and month(发货日期)=" & [M2]
StrSQL = "select 发货日期,count(*),sum([称重/KG]),first(物流方式) from (" & StrSQL & ") group by 发货日期"
Range("B4").CopyFromRecordset Cn.Execute(StrSQL)
End Sub |
评分
-
1
查看全部评分
-
|