Saving workbook from vba

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

I am wanting to save a workbook from a command button on
the first sheet. How can I bring up the save-as dialog
window in vba ? This can be used by anyone using the file
to save wherever he wishes with any file name.
Many thanks in advance for any assistance.
 
Sub SaveTheFile()
Dim FN As String
FN = Application.GetSaveAsFilename()
If UCase(FN) = "FALSE" Then Exit Sub
ThisWorkbook.SaveAs FN
End Sub

Patrick Molloy
Microsoft Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top