PDA

View Full Version : Renaming excel sheet in specific format



NM123
01-03-2013, 09:21 PM
Hi All,

I have excel sheet named as "ST.01.03.019 V*** C** **n Edit Consist, Weight, ACTIVE V0.00.xls" to excute. Once excuted the file name gets changed while saving as "ST.01.03.019 V*** C** **n Edit Consist, Weight, ACTIVE V0.01.xls". using the below code for this.

ThisWorkbook.SaveCopyAs (strDirectoryPath + "\" + Left(ActiveWorkbook.Name _
, Len(ActiveWorkbook.Name) - 6) + "1.xls")

But now i want to save the same file name in a different format. for e.g.
"ST.01.03.019 V0.01 V*** C** **n Edit Consist, Weight, ACTIVE.xls" .
The V0.01 will be placed after the 1st 13 character.

To make you understand...My Parent file will have V0.00.xls, while executing the file name would be changing as mentioned above.

Regards,
NM