Sub 汇总数据()
Application.ScreenUpdating = False
p = "C:\path\" '源文件存放的路径,根据实际修改
f = Dir(p & "*.csv")
Do While f <> ""
Workbooks.Open p & f
r = r + 1
ActiveWorkbook.Sheets(1).Rows(UsedRange.Rows.Count).Copy Workbooks("汇总表.xls").Sheets(1).Cells(r, 1) '汇总表.xls必须存在
ActiveWorkbook.Saved = True
ActiveWindow.Close
f = Dir
Loop
Application.ScreenUpdating = True
End Sub
做是可以做出来的,我知道应该怎么做,可惜还不会做
用VBA可以写出来!
共同关注