Automatic Date Stamping
On Apr 5, 12:01*am, Risky Dave
wrote:
Hi,
I have a macro that works out of an XL file which populates a Word template
with charts.
The macro then saves the template with a new name, using:
With WDDoc
* * * * .SaveAs ("C:\MyReport.doc")
* * End With
Is it possible to save the file with a custom date stamp (yyddmm) so that
the file would be called something like "080404 MyReport.doc"
I can then run the report the next day to produce 080405 MyReport.doc and so
on.
TIA
Dave
Hi Dave,
You almost answered your own question! Just change
.SaveAs ("C:\MyReport.doc")
to
.SaveAs ("C:\" & Format(Date(),"yyddmm") & " MyReport.doc")
Cheers,
Ivan.
|