-
CommandButton - Save in multiple locations
Hi guys, first time poster and new to VBA
I have an excel spreadsheet that has a command button that Saves the file to a specific location on the hard drive using information from the spreadsheet and a date/ time stamp (as below)
This works well, HOWEVER, I need the file to also save a copy in the C drive as it links with a dropbox account
For the life of me I cant seem to workout how to do this, please help this novice.
Thanks n advance
G
Code:
Private Sub CommandButton1_Click()
Dim Path As String
Dim FileName1 As String
Dim dt As String
Path = "D:\JobFiles\"
FileName1 = Range("F2")
dt = Format(CStr(Now), "yyyy_mm_dd_hh_mm")
ActiveSheet.SaveAs FileName:=Path & FileName1 & "-" & dt & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled
End Sub
-
Have you tried: ThisWorkbook.SaveCopyAs FileName
Mark
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules