daspoone
07-04-2018, 05:45 AM
good day,
so I'm not a coder by any stretch of my imagination but I've inherited a workbook that allows me run thousands rows of data, the VBA code transposes data from a sheet into another sheet that performs various calculations based on each row of data (it loops and performs the same function until the last row):at the end of the VBA code it performs a print function, now instead of printing I'd like it to save as a copy (preferably pdf) in sequential files in a specified folder.
The VBA coding currently ends with
shDest.PrintOut 'COPIES:=2
My poor attempt to VBA code a file save as option is below.
Dim filepath As String
Dim filename As String
Dim filepatharch As String
Dim filedate As String
Dim filelist As String
filedate = Format(Now, "MMDD01.")
filepath = "\\C:\Users\PTX\Desktop\FileDrop (file://\\C:\Users\PTX\Desktop\FileDrop)"
tdfilename = "TD" & filedate & filelist & ".xls"
Sheets("TDflatfile").Copy
ActiveWorkbook.SaveAs filename:="\\C:\Users\PTX\Desktop\FileDrop (file://\\C:\Users\PTX\Desktop\FileDrop)"" & tdfilename, FileFormat:=xls,"
Any ideas or suggestions would be greatly appreciated.
so I'm not a coder by any stretch of my imagination but I've inherited a workbook that allows me run thousands rows of data, the VBA code transposes data from a sheet into another sheet that performs various calculations based on each row of data (it loops and performs the same function until the last row):at the end of the VBA code it performs a print function, now instead of printing I'd like it to save as a copy (preferably pdf) in sequential files in a specified folder.
The VBA coding currently ends with
shDest.PrintOut 'COPIES:=2
My poor attempt to VBA code a file save as option is below.
Dim filepath As String
Dim filename As String
Dim filepatharch As String
Dim filedate As String
Dim filelist As String
filedate = Format(Now, "MMDD01.")
filepath = "\\C:\Users\PTX\Desktop\FileDrop (file://\\C:\Users\PTX\Desktop\FileDrop)"
tdfilename = "TD" & filedate & filelist & ".xls"
Sheets("TDflatfile").Copy
ActiveWorkbook.SaveAs filename:="\\C:\Users\PTX\Desktop\FileDrop (file://\\C:\Users\PTX\Desktop\FileDrop)"" & tdfilename, FileFormat:=xls,"
Any ideas or suggestions would be greatly appreciated.