Hi experts,
I was looking for a macro to save a workbook, but also the previous generation. I searched this board and other internet sites but have not found the solution.
I know how to save a workbook, but I was looking for the code to find the existence of previous versions ( the -1 and -2 version).
What I want is something like this:
Sub Savexls()
Xls = filename
If “xls-2” exists then rename as “xls-3” (means overwrite existing xls-3)
If “xls-1” exists then rename as “xls-2”
Rename xls as “xls-1”
Save Xls
"End Excel ??
End Savexls
Where "End Excel" is it possible that the macro closes Excel??
I assume that somewhere such a macro is "on the shelf"
Thanks for your help.
Paul
I was looking for a macro to save a workbook, but also the previous generation. I searched this board and other internet sites but have not found the solution.
I know how to save a workbook, but I was looking for the code to find the existence of previous versions ( the -1 and -2 version).
What I want is something like this:
Sub Savexls()
Xls = filename
If “xls-2” exists then rename as “xls-3” (means overwrite existing xls-3)
If “xls-1” exists then rename as “xls-2”
Rename xls as “xls-1”
Save Xls
"End Excel ??
End Savexls
Where "End Excel" is it possible that the macro closes Excel??
I assume that somewhere such a macro is "on the shelf"
Thanks for your help.
Paul