Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA - Save with new filename
Hi,
I have a macro which runs lots of changes on an excel file, the one thing i am unsure on how to do is to get the end of the macro to save the file with an altered name in the same location as the original file, then close the workbook. e.g. The file is named "Test File 2.xls", and I want it to be called "Test File 2 - altered.xls", to be saved in the same location as the original file, then for the workbook to close. Any suggestions? Thanks, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA - Save with new filename
Hi
You could use SaveCopyAs Dim StrPath As String Dim StrName As String StrPath = "C:\Place\You\Want\To\Save" StrName = "Test File 2 - Altered.xls" ActiveWorkbook.SaveCopyAs StrPath & "\" & StrName MsgBox "Save Complete", vbOKOnly, "Back UPs" Hope this helps S Louise wrote: Hi, I have a macro which runs lots of changes on an excel file, the one thing i am unsure on how to do is to get the end of the macro to save the file with an altered name in the same location as the original file, then close the workbook. e.g. The file is named "Test File 2.xls", and I want it to be called "Test File 2 - altered.xls", to be saved in the same location as the original file, then for the workbook to close. Any suggestions? Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell("filename") doesn't update to new filename when do save as. | Excel Worksheet Functions | |||
VBA - Save with New Filename | Excel Programming | |||
save as different filename | Excel Programming | |||
Save Filename | Excel Programming | |||
save as filename | Excel Programming |