Save As Macro

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.
 
G

Guest

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
 
D

Dave Peterson

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.
 
G

Guest

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
 

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

Top