|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Set SH0 = Sheets("统计")
- SH0.Range("A3:B65536").ClearContents
- INTX = 0
- FileArr = FileAllArr(ThisWorkbook.Path, "*.xls?", ThisWorkbook.Name, True, False)
- For I = 0 To UBound(FileArr)
-
- Str_coon = "HDR=yes;imex=1';Data Source =" & FileArr(I) '//OFFICE2003,2007 通用
- StrSQL = "SELECT COUNT(运单号) AS 个数 FROM [export$a:a] WHERE LEN(运单号)>0"
- SQLARR = GET_SQL_To_Arr(StrSQL, Str_coon, False)
- SH0.Cells(I + 3, 1) = GetPathFromFileName(FileArr(I))
- SH0.Cells(I + 3, 2) = SQLARR(0, 0)
- INTX = INTX + SQLARR(0, 0)
- Next I
- LASTROW = SH0.Range("B65536").End(3).Row + 1
- SH0.Cells(LASTROW, 1) = "合计"
- SH0.Cells(LASTROW, 2) = INTX
复制代码 |
|