Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save Workbook with existing Name in the Folder
Hi all, I have code below which save the current worksheet as
separate workbook in folder "Record" Private Sub CommandButton17_Click() Me.Select Me.Copy ActiveWorkbook.SaveAs Filename:="C:\Documents\Record\" & Left(Range ("A13").Value, Len(Range("A13").Value) - 5) & " ( " & Range ("D23").Value & " )" & ".xlsm", FileFormat:= _ xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False ActiveWindow.Close End Sub I need some code to put in above macro which should check first if there is any name of existing workbook in the folder which is same of new workbook which is going to be save in that folder and if the names are same then macro should put like 1 , 2 at the end of new workbook name so it can be save. I want the same names but want to make them different by putting numbers at the end of the workbookname like 1 , 2 , 3 ..... etc. I hope i was able to explain my question. Please can any friend can help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to save existing Workbook with a new new name, without changingthe open Workbook name? | Excel Programming | |||
Force a Readonly Workbook to save to a different folder | Excel Discussion (Misc queries) | |||
save workbook created from templete to a specific folder | Excel Discussion (Misc queries) | |||
code to save the whole folder with a workbook | Excel Programming | |||
code to save the whole folder in which is the workbook | Excel Programming |