ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save file with last month date on end (https://www.excelbanter.com/excel-programming/411689-save-file-last-month-date-end.html)

Les

Save file with last month date on end
 
Hi all, i am wanting to save a file "myFile.xls" as "myFile_Apr-08.xls".

It must always be the last month to present date.

Any help would be much appreciated.

--
Les

Mike H

Save file with last month date on end
 
Les,

Try this

fname = "myfile_" & DateSerial(Year(Date), Month(Date) + 1, 0)

Mike

"Les" wrote:

Hi all, i am wanting to save a file "myFile.xls" as "myFile_Apr-08.xls".

It must always be the last month to present date.

Any help would be much appreciated.

--
Les


Per Jessen

Save file with last month date on end
 
Hi Les

This should get you started:

m = MonthName(Month(Now()) - 1, True)
SaveName = "MyFile_" & m & "-" & Right(Year(Now()), 2)

Regards,
Per

"Les" skrev i meddelelsen
...
Hi all, i am wanting to save a file "myFile.xls" as "myFile_Apr-08.xls".

It must always be the last month to present date.

Any help would be much appreciated.

--
Les



Les

Save file with last month date on end
 
Thanks Mike
--
Les


"Mike H" wrote:

Les,

Try this

fname = "myfile_" & DateSerial(Year(Date), Month(Date) + 1, 0)

Mike

"Les" wrote:

Hi all, i am wanting to save a file "myFile.xls" as "myFile_Apr-08.xls".

It must always be the last month to present date.

Any help would be much appreciated.

--
Les



All times are GMT +1. The time now is 10:23 PM.

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