#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Save As Macro

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.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Save As Macro

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


--
Gary''s Student - gsnu200734


"el zorro" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Save As Macro

You'd need a macro that contained something like:

Option Explicit
Sub SaveMe()

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

End Sub

There isn't any validation for the filename. You may want to add some checks.

el zorro wrote:

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.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Save As Macro

This worked great. Thanks much.

"Gary''s Student" wrote:

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


--
Gary''s Student - gsnu200734


"el zorro" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
Save as Macro MikeD1224 Excel Discussion (Misc queries) 1 February 16th 07 11:08 PM
Macro Save As John Excel Discussion (Misc queries) 1 June 1st 06 12:44 PM
Macro-Save as Lois Excel Discussion (Misc queries) 4 May 20th 05 10:53 PM
Macro to save John Excel Worksheet Functions 2 April 29th 05 12:38 AM


All times are GMT +1. The time now is 08:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"