I am using this code to save a range within a sheet as pdf to a specific folder.
Currently I have to write the pdf name that I want, but I would like the file name to be automatically assigned. More specifically I would like the name to be equal to: Cell B2 Value & "." & Cell D4 Value.
How can I add this to my code?
Thanks
Code:
Dim rng As Range
Dim fPathFile As Variant
Set rng = Range("A1:H47")
fPathFile = Application.GetSaveAsFilename(filefilter:="PDF Files (*.pdf), *.pdf")
If fPathFile <> False Then
rng.ExportAsFixedFormat Type:=xlTypePDF, Filename:=fPathFile, quality:=xlQualityStandard, _
includedocproperties:=True, ignoreprintareas:=True, openafterpublish:=True
End If
Currently I have to write the pdf name that I want, but I would like the file name to be automatically assigned. More specifically I would like the name to be equal to: Cell B2 Value & "." & Cell D4 Value.
How can I add this to my code?
Thanks