J7House1984
New Member
- Joined
- Oct 30, 2020
- Messages
- 21
- Office Version
- 365
- Platform
- Windows
Hello,
I am a beginner at VBA, I know enough to get myself stuck frequently. I am trying to write a VBA script, for archiving purposes, to write a copy of file and add a timestamp in this format (mm_dd_yyy) and place the copied file in a specific folder.
The location folder path is H:\fbqf9009\Documents\Campaigns\Campaign Reporting.
The end result would ideally be Filename mm_dd_yyy.xls
The script I have thus far is and I getting error messages. I know this is isn't everything I am trying to do in the script but I am stuck and need help.
Please help?!?
I am a beginner at VBA, I know enough to get myself stuck frequently. I am trying to write a VBA script, for archiving purposes, to write a copy of file and add a timestamp in this format (mm_dd_yyy) and place the copied file in a specific folder.
The location folder path is H:\fbqf9009\Documents\Campaigns\Campaign Reporting.
The end result would ideally be Filename mm_dd_yyy.xls
The script I have thus far is and I getting error messages. I know this is isn't everything I am trying to do in the script but I am stuck and need help.
VBA Code:
Sub SaveArchive()
Dim dt As String
WbName As String
WbName = "ActiveWorkbook.name"
dt = Format(CStr(Now), "mm_dd_yyyy")
ActiveWorkbook.SaveAs Filename:=WbName & dt
End Sub
Please help?!?