Results 1 to 3 of 3

Thread: Save currWkbk Name as "String&currDate"?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Location
    boston
    Posts
    22
    Hello,

    Is it possible to have a macro save a workbook with the same name everyday but at the end of the name put the current date?

    I would greatly appreciate any example code if someone knows. Thank you and best regards.

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    I do not know about the Macro and Workbook, but in VB I use this code to append the current date to a folder name.

    Code:
        DestinationFolder = "c:\backups\travel\Data(" & Format(Now, "mm-dd-yy") & ")"
    Result is c:\backups\travel\Data(10-27-00)

  3. #3
    Lively Member
    Join Date
    Oct 2000
    Location
    Chicago
    Posts
    97

    Yes you can do it.....

    Hi,
    Yes you can very well do that ....

    Here is a sample.Have a look at it.
    Code:
    --------------------------------------------------------
    sMonth = Format(Month(Date), "00")
    sYear = Format(Year(Date), "0000")
    sDay = Format(Day(Date), "00")
    sFileName = "Whatever Name " & sYear & sMonth & sDay

    xlApp.ActiveWorkbook.SaveAs "C:\" & sFileName
    --------------------------------------------------------
    In this way you can save with same name and with current date.

    Hope this will help you

    Good Luck
    Anil

Posting Permissions

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



Click Here to Expand Forum to Full Width