Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
save original data after macro is run again | New Users to Excel | |||
macro to save file automaticaly? | Excel Discussion (Misc queries) | |||
Macro to save | Excel Worksheet Functions | |||
help with macro to save repeating data entry | Excel Discussion (Misc queries) | |||
This one is tricky....Macro to save file as cell value x in di | Excel Discussion (Misc queries) |