Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Save file with last month date on end

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Les - 29 May 2008 12:02 GMT
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.

Signature

Les

Mike H - 29 May 2008 12:18 GMT
Les,

Try this

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

Mike

> 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 - 29 May 2008 12:28 GMT
Thanks Mike
Signature

Les

> Les,
>
[quoted text clipped - 9 lines]
> >
> > Any help would be much appreciated.
Per Jessen - 29 May 2008 12:24 GMT
Hi Les

This should get you started:

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

Regards,
Per

> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.