问题
Well, I am not a developer but an regular an Excel user try to automate some process while working so please understand if my question is of simple to do.
I just want to a macro that can when I run the macro, it will allow me to Browse the computer so I can save the file in the direction and file name I like If possible Default location is the location of the workbook, just to save time
Thank you
回答1:
Try below code :
Sub SaveAsDailog()
Application.DisplayAlerts = False
Dim filePath As Variant
filePath = Application.GetSaveAsFilename("abcd.xlsx", "Excel Files (*.xlsx), *.xlsx")
If VarType(filePath) = vbString Then
ActiveWorkbook.SaveAs Filename:=filePath
End If
Application.DisplayAlerts = True
End Sub
来源:https://stackoverflow.com/questions/15886130/save-a-worksheet-with-form-save-as-location-in-excel-vba