|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
初学者,帮忙看一下,我想对同一文件夹下多个相同格式中某一个工作表进行数据累加,累加区域为F16:FW1083,您看看编码哪里不对
Sub 汇总()
Dim cFile$, cPath$, nL%
Application.ScreenUpdating = False
Application.EnableEvents = False
nL = 5
cPath = ThisWorkbook.Path & "\上报文件\"
cFile = Dir(cPath & "*.*")
Do While cFile <> ""
nL = nL + 174
Cells(16, nL).Resize(1068, 174).Formula = "='" & cPath & "[" & cFile & "]数量输入'!f16:$fw1083"
cFile = Dir
Loop
Range("f16:f1083").Formula = "=sum(f4:iv4)"
Range("f16:f1083").Value = Range("f16:f1083").Value
Range("f4:iv49").ClearContents
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
|
|