Hi all
Ive had a look through the discussion board and cant quite find what i was looking for, or the codes were very different.
The idea is a macro button which saves to a specific location, saves as a PDF, saves name as todays date.
Please find code below.
Currently it is saving the PDF in the locations 1 file back, as the file name it is currently in, which is different to where I would like the output.
Any suggestions would be greatly appreciated.
Cheers
Private Sub SaveRangeAsPDF()
Dim PrintRng As Range
Dim SavePDF As String
Sheets("Week Review").Select
Set PrintRng = Range("B1:O127")
SavePDF = strPath
strPath = "L:\Mining\Underground\06.Dept General\Weekly Review" & Format(Now, "yyyy-mm-dd")
PrintRng.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=SavePDF, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub
Ive had a look through the discussion board and cant quite find what i was looking for, or the codes were very different.
The idea is a macro button which saves to a specific location, saves as a PDF, saves name as todays date.
Please find code below.
Currently it is saving the PDF in the locations 1 file back, as the file name it is currently in, which is different to where I would like the output.
Any suggestions would be greatly appreciated.
Cheers
Private Sub SaveRangeAsPDF()
Dim PrintRng As Range
Dim SavePDF As String
Sheets("Week Review").Select
Set PrintRng = Range("B1:O127")
SavePDF = strPath
strPath = "L:\Mining\Underground\06.Dept General\Weekly Review" & Format(Now, "yyyy-mm-dd")
PrintRng.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=SavePDF, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub