+ Reply to Thread
Results 1 to 4 of 4

Adding Today's Date to a Filename

  1. #1
    Forum Contributor
    Join Date
    06-13-2009
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    245

    Smile Adding Today's Date to a Filename

    Hello, I am using Excel 2003 in Windows XP. I have written a macro to save my active workbook to my home drive. However, I need to add today's date to the workbook's filename.

    The following code saves my workbook named: Letters Not Sent - Contractor - within Australia (ready for Mail Merge).xls

    ActiveWorkbook.SaveAs ("C:\EXCEL\Letters Not Sent - Contractor - within Australia (ready for Mail Merge).xls")

    I need the workbook's file name to look the following example (assuming today's date is the 07 Dec 12):

    Letters Not Sent - Contractor - within Australia (ready for Mail Merge) (07 Dec 12).xls

    I do not know how to add today's date to the filename?

    Could someone kindly assist me - it would be greatly appreciated.

    Kind regards,

    Chris
    Last edited by longbow007; 12-06-2012 at 07:10 PM.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Adding Today's Date to a Filename

    Please Login or Register  to view this content.
    Gary's Student

  3. #3
    Forum Contributor
    Join Date
    06-13-2009
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    245

    Re: Adding Today's Date to a Filename

    Hello Jakoshavn, thank you for your excellent code - very much appreciated

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Adding Today's Date to a Filename

    You are quite welcome. thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1