T
Thulasiram
I have a macro (given below) that saves a new workbook with the name
Book1. Next time when the macro is executed, how the code should be
tweaked such that the new workbook is saved in a different name? I
tried using "i" loop but that doesnt merge well in my case as this
part is a part of a huge code. I
In short, I would like to have a macro for the following algorithmn
for this one:
If the filename is already found, then add any character (number,
alphabet) to save it as a different file name.
For example, initial save gives Book1.xls.
Next save finds Book1.xls, the filename should be renamed as
Book11.xls or Book1a.
Next save finds Book1 and Book11/Book1a. So, the filename should be
renamed as Book111 or Book11a or....
So on....
Can someone please help me with the macro?
ActiveWorkbook.SaveAs Filename:= _
"C:\Book1.xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False
Thanks!
Thulasiram
Book1. Next time when the macro is executed, how the code should be
tweaked such that the new workbook is saved in a different name? I
tried using "i" loop but that doesnt merge well in my case as this
part is a part of a huge code. I
In short, I would like to have a macro for the following algorithmn
for this one:
If the filename is already found, then add any character (number,
alphabet) to save it as a different file name.
For example, initial save gives Book1.xls.
Next save finds Book1.xls, the filename should be renamed as
Book11.xls or Book1a.
Next save finds Book1 and Book11/Book1a. So, the filename should be
renamed as Book111 or Book11a or....
So on....
Can someone please help me with the macro?
ActiveWorkbook.SaveAs Filename:= _
"C:\Book1.xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False
Thanks!
Thulasiram