#1
|
|||
|
|||
save a file with a predetermined date in VBA
Y'ello. I want to create a macro that will save a document with a predetermined day of the week (always the next Saturday) in the title, e.g. If I were to save the file today the macro would call the document "2013-03-29 Expense Reimbursement" I know, and thank, MACROPOD for the calculated date formula that accomplishes this in a form field, but I want to do it in VBA for a Macro button. The "only" piece I'm missing is the bit that would generate the date (I know how to choose a file location and add "Expense Reimbursement" to the title). |
#2
|
||||
|
||||
Try something based on:
Code:
Sub Demo() Dim StrDate As String StrDate = Format(Int(Date / 7 + 1) * 7, "YYYY MM DD") MsgBox StrDate End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
error: You are attempting to save a file format that is blocked by file block setting | zatlas1 | Office | 8 | 04-28-2012 02:37 PM |
Insert date when save file | gg80 | Excel Programming | 3 | 01-29-2011 08:36 AM |
How to update automatically the “file name” as we do for the “Date”? | Jamal NUMAN | Word | 2 | 01-06-2011 02:43 PM |
Word Macro: Save file as text with current file name | jabberwocky12 | Word VBA | 2 | 10-22-2010 12:23 PM |
How to save file on CD? | DennisWG | Word | 0 | 09-07-2010 10:41 AM |