title: How to Add Date and Time To File Name Using VBA in Excel
body: <p>Thanks to Siddharth Rout at <a href="https://stackoverflow.com/questions/20632514/issue-on-saving-active-sheet-as-new-worksheet/20632628#20632628">this Post</a> I learned how to save a sheet to a new Worksheet. Now my question is how I can add Date and Time of file creation like:</p>
  
  <blockquote>
    <p>TestSheet_25May2013_5pm.xls</p>
  </blockquote>
  
  <pre><code>Sub SaveSheet()
      Dim FName As String
  
      ActiveSheet.Copy
      With ActiveSheet.UsedRange
          .Copy
          .PasteSpecial xlValues
          .PasteSpecial xlFormats
      End With
      Application.CutCopyMode = False
  
  
      FName = "C:\Users\somebody\Documents\TestSheet" &amp; Format(Range("E19"), "mmm-d-yyyy") &amp; ".xlsm"
      ActiveWorkbook.SaveAs Filename:=FName, _
                            FileFormat:=xlOpenXMLWorkbookMacroEnabled
  
  
  
  End Sub
  </code></pre>
  
  <p>can you please let me know how to do this?</p>