#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto Save


Hi,

Does anyone have any suggestionsfor a Macro that would save the current
workbook with the file name-prior month/year.

For example this month (August) the file would be saved as:

Expenses July 2005.xls

Next month (September)

Expenses August 2005.xls

Thanks for your help!


--
STEVEB
------------------------------------------------------------------------
STEVEB's Profile: http://www.excelforum.com/member.php...fo&userid=1872
View this thread: http://www.excelforum.com/showthread...hreadid=391980

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto Save


Here is a macro that should do what you want.

Sub SaveAsLastMonth()
Dim LastMonth As String, ThisYear As String
If Month(Date) = 1 Then
LastMonth = "December"
ThisYear = Year(Date) - 1
Else
LastMonth = MonthName(Month(Date) - 1)
ThisYear = Year(Date)
End If
ActiveWorkbook.SaveAs ("Expenses " & LastMonth & " " & ThisYear &
".xls")
End Sub

enjoy


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=391980

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Auto Save

Steve,

Found this interesting function...

filen = "Expenses " & Format(DateAdd("m", -1, Date), "mmmm yyyy")

use filen in your save-as code.

--
steveB

Remove "AYN" from email to respond
"STEVEB" wrote in
message ...

Hi,

Does anyone have any suggestionsfor a Macro that would save the current
workbook with the file name-prior month/year.

For example this month (August) the file would be saved as:

Expenses July 2005.xls

Next month (September)

Expenses August 2005.xls

Thanks for your help!


--
STEVEB
------------------------------------------------------------------------
STEVEB's Profile:
http://www.excelforum.com/member.php...fo&userid=1872
View this thread: http://www.excelforum.com/showthread...hreadid=391980



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto Save


Thanks bhofsetz & Steve Bell

Both suggestions worked great! I really appreciate your help! It save
me alot of time

--
STEVE
-----------------------------------------------------------------------
STEVEB's Profile: http://www.excelforum.com/member.php...nfo&userid=187
View this thread: http://www.excelforum.com/showthread.php?threadid=39198

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
auto save feature (not auto recovery) Dawnee Excel Discussion (Misc queries) 3 January 20th 09 09:47 PM
Excel 2007 auto-recovery / auto-save? gpurdue Setting up and Configuration of Excel 0 May 23rd 08 10:19 PM
auto save ziad New Users to Excel 1 January 4th 08 01:39 PM
How to AUTO SAVE as opposed to turning on auto recovery: EXCEL T-mo Excel Discussion (Misc queries) 1 January 12th 06 10:16 PM
Auto Excel workbook close: save= false during an auto subroutine tomwashere2 Excel Programming 10 June 16th 05 06:23 AM


All times are GMT +1. The time now is 03:35 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"