How do I save a spreadsheet from a macro?

  • Thread starter Thread starter Cortez
  • Start date Start date
C

Cortez

I need to create a macro to "save as" the spreadsheet to a specific
folder, with a unique (date/time based) file name.

Is there a "save as" command that can be used from a macro so that
this can be done? I can sort out the file naming procedure, unless
you have any suggestions on that as well.

Thanks,

TK
 
For example:

Sub cortez()
s1 = "C:\Documents and Settings\User\Desktop"
s2 = "\Bookx"
s3 = Format(Now(), "mm_dd_yyyy") & ".xls"

ChDir s1
ActiveWorkbook.SaveAs Filename:=s1 & s2 & s3
End Sub
 
For example:

Sub cortez()
s1 = "C:\Documents and Settings\User\Desktop"
s2 = "\Bookx"
s3 = Format(Now(), "mm_dd_yyyy") & ".xls"

ChDir s1
ActiveWorkbook.SaveAs Filename:=s1 & s2 & s3
End Sub

--
I came back to reply that I found it:

ActiveWorkbook.SaveAs Filename:="etc"

and saw that you gave me the whole thing. Thank you very much.

TK
 
Back
Top