Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
rename current file save and delete original | Excel Programming | |||
How to set SAVE AS file name to equal A1 contents when rename file | Excel Discussion (Misc queries) | |||
overwriting a file | Excel Programming | |||
Macros in Excel - Save as and rename file | Excel Programming | |||
Macros in Excel - Save as and rename file | Excel Programming |