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
Remove "AYN" from email to respond
"STEVEB" <STEVEB.1t3vqh_1122933934.8035@excelforum-nospam.com> wrote in
message news:STEVEB.1t3vqh_1122933934.8035@excelforum-nospam.com...
>
> 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
>
Bookmarks