Do While f <> "" 缺少结束语!!!
答案:1 悬赏:10 手机版
解决时间 2021-01-30 16:00
- 提问者网友:相思似海深
- 2021-01-29 20:43
Do While f <> "" 缺少结束语!!!
最佳答案
- 五星知识达人网友:西岸风
- 2021-01-29 20:59
你没有声明变量
dim f , p,r追问怎么写!我不会!谢谢!追答Sub 汇总数据()
Dim p, f, r
Application.ScreenUpdating = False
p = "d:\提取\"
f = Dir(p & "*.xls")
r = 0
Do While f <> ""
Workbooks.Open p & f
r = r + 1
ActiveSheet.Rows(2).Copy
Workbooks("汇总.xls").Sheets("sheet1").Activate
ActiveSheet.Range("A" & r).Select
ActiveSheet.Paste
Application.CutCopyMode = xlCut
Workbooks(f).Activate
ActiveWorkbook.Saved = True
ActiveWindow.Close
f = Dir
Loop
Application.ScreenUpdating = True
End Sub
dim f , p,r追问怎么写!我不会!谢谢!追答Sub 汇总数据()
Dim p, f, r
Application.ScreenUpdating = False
p = "d:\提取\"
f = Dir(p & "*.xls")
r = 0
Do While f <> ""
Workbooks.Open p & f
r = r + 1
ActiveSheet.Rows(2).Copy
Workbooks("汇总.xls").Sheets("sheet1").Activate
ActiveSheet.Range("A" & r).Select
ActiveSheet.Paste
Application.CutCopyMode = xlCut
Workbooks(f).Activate
ActiveWorkbook.Saved = True
ActiveWindow.Close
f = Dir
Loop
Application.ScreenUpdating = True
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯