Sub SUBSaveNewStatement()
'
' Newstatement1 Macro
' copy and save to new file for a new account statement.
'
'
Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'Set the output path and file name
outputPath = "C:\Users\bdumitrascu\OneDrive - PTC\Documents\Account statements"
CustomerName = Range("B2").Value
CustomerNumber = Range("C2").Value
CustomerSite = Range("E2").Value
outputFileName = CustomerName & " - " & CustomerNumber & " - " & CustomerSite & " - Updated Statement - " & Format(Date, "dd-MMM-yyyy") & ".xlsx"
ActiveWorkbook.SaveAs filename:=outputPath & "\" & outputFileName, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub
Sub SvMe()
'Saves filename
Dim newFile As String, outputFileName As String
dim outputpath As String
'Change the date format to whatever you'd like, but make sure it's in quotes
outputpath = "C:\Users\bdumitrascu\OneDrive - PTC\Documents\Account statements"
outputFileName = CustomerName & " - " & CustomerNumber & " - " & CustomerSite & " - Updated Statement - " & Format(Date, "dd-MMM-yyyy") & ".xlsx"
' Change directory to suit your PC, including USER NAME
ChDir _
"C:\Users\bdumitrascu\OneDrive - PTC\Documents\Account statements"
ActiveWorkbook.SaveAs filename:= outputpath & "\" & outputFileName
End Sub