Save As Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to create a macro to save an Excel file using the text stored
in a cell (A1 for example) as its filename. At this time cell A1 will
contain "LastName FirstName mmddyy". If possible, please help.
 
Perhaps:

Sub store_A()
Dim s As String
s = "C:\Documents and Settings\Owner\My Documents\" & Range("A1").Value &
".xls"
ActiveWorkbook.SaveAs Filename:=s
End Sub
 
You'd need a macro that contained something like:

Option Explicit
Sub SaveMe()

with Thisworkbook
.saveas filename:=.worksheets("sheet999").range("x88").value & ".xls", _
fileformat:=xlworkbooknormal
end with

End Sub

There isn't any validation for the filename. You may want to add some checks.
 
This worked great. Thanks much.

Gary''s Student said:
Perhaps:

Sub store_A()
Dim s As String
s = "C:\Documents and Settings\Owner\My Documents\" & Range("A1").Value &
".xls"
ActiveWorkbook.SaveAs Filename:=s
End Sub
 
Back
Top