发布于2025-01-21 阅读(0)
扫一扫,手机访问
Sub Test()
Dim myPath As String, MyName As String
myPath = "C:\Documents\" 'Get Path
MyName = Dir(myPath) 'find the first file
If Right(MyName, 4) = ".csv" Then Workbooks.Open Filename:=myPath & MyName
Do While MyName ""
MyName = Dir 'find next
If Right(MyName, 4) = ".csv" Then Workbooks.Open Filename:=myPath & MyName
Loop
End Sub
Sub DateSave()
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
ThisWorkbook.Path & "\" & Date & ".xls", _
FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
Application.DisplayAlerts = True
End Sub
请将“ThisWorkbook.Path & "\" & Date & ".xls", _”改为“"d:\" & Date & ".xls", _”,其中“"d:\" ”就是你要存的路径。
希望我的回答对你有所帮助。
下一篇:解决U盘驱动错误的详细步骤
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店