Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
auto save feature (not auto recovery) | Excel Discussion (Misc queries) | |||
Excel 2007 auto-recovery / auto-save? | Setting up and Configuration of Excel | |||
auto save | New Users to Excel | |||
How to AUTO SAVE as opposed to turning on auto recovery: EXCEL | Excel Discussion (Misc queries) | |||
Auto Excel workbook close: save= false during an auto subroutine | Excel Programming |