ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save file with new name(Save As) (https://www.excelbanter.com/excel-programming/371377-save-file-new-name-save.html)

ewagz

Save file with new name(Save As)
 
I was looking for some code that will take the current file name and use
'Save As' to name it with the current path:
G:\COMMAND-CENTER\Accounts\account name\name PMR\***the new file name as
'name PMR mm/dd/yyyy'

This name will need to reflect the previous day's date.

Any help would be appreciated!

Thanks
--
EW - Analyst

Ron de Bruin

Save file with new name(Save As)
 
Hi ewagz

Try this

Dim wb As Workbook
Dim strdate As String
strdate = Format(Date, "mm-dd-yyyy")
Set wb = ActiveWorkbook
With wb
.SaveAs "G:\COMMAND-CENTER\Accounts\account name\name PMR " & strdate & ".xls"
.Close False
End With


--
Regards Ron de Bruin
http://www.rondebruin.nl



"ewagz" wrote in message ...
I was looking for some code that will take the current file name and use
'Save As' to name it with the current path:
G:\COMMAND-CENTER\Accounts\account name\name PMR\***the new file name as
'name PMR mm/dd/yyyy'

This name will need to reflect the previous day's date.

Any help would be appreciated!

Thanks
--
EW - Analyst




Ron de Bruin

Save file with new name(Save As)
 
Remove this line if you not want to close the file
.Close False

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Ron de Bruin" wrote in message ...
Hi ewagz

Try this

Dim wb As Workbook
Dim strdate As String
strdate = Format(Date, "mm-dd-yyyy")
Set wb = ActiveWorkbook
With wb
.SaveAs "G:\COMMAND-CENTER\Accounts\account name\name PMR " & strdate & ".xls"
.Close False
End With


--
Regards Ron de Bruin
http://www.rondebruin.nl



"ewagz" wrote in message ...
I was looking for some code that will take the current file name and use
'Save As' to name it with the current path:
G:\COMMAND-CENTER\Accounts\account name\name PMR\***the new file name as
'name PMR mm/dd/yyyy'

This name will need to reflect the previous day's date.

Any help would be appreciated!

Thanks
--
EW - Analyst







All times are GMT +1. The time now is 01:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com