Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I set a file to auto-open and save at each month begin date? Dominic Excel Discussion (Misc queries) 9 August 8th 09 05:57 PM
Recovering File Info Specifically Save Date or Print Date Gadgetgw Excel Discussion (Misc queries) 4 October 6th 08 08:43 PM
Macro to save Excel file with date and time in the file name? sonic_d_hog Excel Programming 2 January 5th 06 05:57 PM
Automatically save report to new file name each month mhayli Excel Programming 5 October 4th 05 02:47 AM
CREATING NEW WORKBOOK FILE EVERY MONTH AND NEW WORKSHEET EVERY DATE michael sofianos Excel Programming 1 May 9th 05 10:46 PM


All times are GMT +1. The time now is 05:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"