#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 184
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 184
Default 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
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 Insert Current Date into cell - Macro to "Save As" Guy[_2_] Excel Worksheet Functions 4 December 12th 08 08:20 PM
Please help macro for save DP7 Excel Worksheet Functions 1 October 11th 07 10:31 PM
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
Save a Macro ducttape Excel Discussion (Misc queries) 3 February 20th 06 04:46 PM
Macro to save John Excel Worksheet Functions 2 April 29th 05 12:38 AM


All times are GMT +1. The time now is 12:50 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"