Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004

    Question Unanswered: saving files (VBA)


    I would appreciate help with VBA.

    I have written a macro that performs a computation every day. I would like to save the computation daily with a different name. For example, I would like to call the result with the current date as the file name. How can I do this?

    Many thanks,


  2. #2
    Join Date
    Feb 2004
    My question was rather trivial. I apologize. I used VBA today for the first time.

    Anyhow, here is one way to do what is required (saving the files on the Desktop):

    Sub GiveNameAsDate()
    Dim SendPath, NameFile, SaveAsFile, DateNow
    SendPath = "C:\Documents and Settings\Desktop\"
    DateNow = Application.Text(Now(), ";@")
    NameFile = "FileName"
    SaveAsFile = DateNow
    NameFile = NameFile & SaveAsFile
    ActiveWorkbook.SaveAs Filename:=SendPath & NameFile, _
    FileFormat:=xlNormal, CreateBackup:=False
    End Sub

Posting Permissions

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