Save filename plus last month's date

T

Tiffany

How can I save last month's date in the file name,
I have it working so that it saves the current month's name, ie Dec 08 in
the filename, but I actually want Nov 08, as these are monthly reports.
 
R

Rick Rothstein

Showing your existing (related) code is always a good idea. In the absence
of seeing your code, the best I can suggest is to concatenate this
expression...

Format(DateAdd("m", -1, Now), "mmm yy")

into the base name for your file.
 
C

Chip Pearson

You can use something like

ThisWorkbook.SaveAs "C:\Test\Book_" & Format(Now,"mmm_yy") & ".xls"

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top