Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro for Save As
I am looking for help with a macro that will run save as and place the file
in the same path as the file being saved as and adding a back to the end of the file before .xls. Origional file B:\One\Two\Origional.xls Save as file B:\One\Two\Origionalback.xls Thank you |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro for Save As
In principal, thsi is waht you are looking for:
================== Sub SaveAsBAckUp() NFN = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) & "BACK" FULL = ActiveWorkbook.Path & "\" & NFN & ".XLS" ActiveWorkbook.SaveAs FULL End Sub ============== Note: Running the macro - TWICE - on the same File will add another BACK string. If you intend to run it on the same file more than once then add a check for the presence of BACK in the name - normally this is done with INSTR command. Micky "Jeremy" wrote: I am looking for help with a macro that will run save as and place the file in the same path as the file being saved as and adding a back to the end of the file before .xls. Origional file B:\One\Two\Origional.xls Save as file B:\One\Two\Origionalback.xls Thank you |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro for Save As
Works great but I forgot to add one thing. How would you put the current
date at the end of "Back"? Thank you "מיכאל (מיקי) אבידן" wrote: In principal, thsi is waht you are looking for: ================== Sub SaveAsBAckUp() NFN = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) & "BACK" FULL = ActiveWorkbook.Path & "\" & NFN & ".XLS" ActiveWorkbook.SaveAs FULL End Sub ============== Note: Running the macro - TWICE - on the same File will add another BACK string. If you intend to run it on the same file more than once then add a check for the presence of BACK in the name - normally this is done with INSTR command. Micky "Jeremy" wrote: I am looking for help with a macro that will run save as and place the file in the same path as the file being saved as and adding a back to the end of the file before .xls. Origional file B:\One\Two\Origional.xls Save as file B:\One\Two\Origionalback.xls Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Insert Current Date into cell - Macro to "Save As" | Excel Worksheet Functions | |||
Please help macro for save | Excel Worksheet Functions | |||
Macro to Save without the Save Message | Excel Discussion (Misc queries) | |||
Save a Macro | Excel Discussion (Misc queries) | |||
Macro to save | Excel Worksheet Functions |