#1   Report Post  
Posted to microsoft.public.excel.misc
John
 
Posts: n/a
Default Macro Save As

I created a macro to save a file, but I want to be able to archive it in a
folder and change the name each time. As I have it noe it replaces the
existing file. How can I get the dialog window to appear to Save As a new
file?
--
John
  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Macro Save As

This is what I use.....it's set as generic and must be tweaked for each
application.

Sub SaveArchive()
' Saves the workbook to a predetermined Archive
'Directory and appends date and time to filename,
' then re-configures file so it will naturally be saved to
'the directory from whence it came.
CurrentPath = CurDir
ArchivePath = "C:\SpecifyYourPathHere"
WorkBookName = ActiveWorkbook.Name
Fname = ArchivePath
Fname = Fname + Worksheets("YourSheetName").Range
_("YourSelectedCell").Value 'Used to name archived file to cell value
Fname = Fname & Format(Time, "_hh_mm_ss") & Format _(Date,
"_Mmm_dd_yyyy")
Range("a8").Select
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Fname
Fname = CurrentPath + "\" + WorkBookName
ActiveWorkbook.SaveAs Fname
Application.DisplayAlerts = True
End Sub

hth
Vaya con Dios,
Chuck, CABGx3



"John" wrote:

I created a macro to save a file, but I want to be able to archive it in a
folder and change the name each time. As I have it now it replaces the
existing file. How can I get the dialog window to appear to Save As a new
file?
--
John

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
save original data after macro is run again MINAL ZUNKE New Users to Excel 3 July 7th 05 12:48 PM
macro to save file automaticaly? david Excel Discussion (Misc queries) 1 May 6th 05 05:21 PM
Macro to save John Excel Worksheet Functions 2 April 29th 05 12:38 AM
help with macro to save repeating data entry Tom Excel Discussion (Misc queries) 0 February 16th 05 04:24 AM
This one is tricky....Macro to save file as cell value x in di Andy Excel Discussion (Misc queries) 4 November 26th 04 08:52 AM


All times are GMT +1. The time now is 10:47 PM.

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"