Hello All,
I am using the code below to save a worksheet as a PDF in a specific file path. Works fine.
What I need to have it do now is to create and save the PDF in the same file path location but add a specific folder for the current year that is located in the file path. The year will obviously change, I have a helper cell that I am trying to reference into the file path but I am failing miserably at it. The referenced cell is AX11.
Thanks in advance.
Tim
Sub SaveAsPDFTractorInternalWorkOrder()
'Saves active worksheet named Tractor Internal Work Order as pdf using Range
'of AX2,AX4'
Dim fName As String
With ActiveSheet
fName = .Range("B14").Value & "." & .Range("AX2").Value & " " & .Range("AX4").Value
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\Tim\Dropbox\PCL\PCL Work Orders\Tractor Internal Work Orders\" & fName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End With
End Sub
I am using the code below to save a worksheet as a PDF in a specific file path. Works fine.
What I need to have it do now is to create and save the PDF in the same file path location but add a specific folder for the current year that is located in the file path. The year will obviously change, I have a helper cell that I am trying to reference into the file path but I am failing miserably at it. The referenced cell is AX11.
Thanks in advance.
Tim
Sub SaveAsPDFTractorInternalWorkOrder()
'Saves active worksheet named Tractor Internal Work Order as pdf using Range
'of AX2,AX4'
Dim fName As String
With ActiveSheet
fName = .Range("B14").Value & "." & .Range("AX2").Value & " " & .Range("AX4").Value
.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\Tim\Dropbox\PCL\PCL Work Orders\Tractor Internal Work Orders\" & fName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End With
End Sub