Hello there,
For the moment i use the code below to export a certain range from a sheet as pdf file in a folder "C:\Test.
This works fine but now i would like the possibility that the user can choose where he wants to save the file and with wich name.
Kind off like the basic "Save As" in Office.
It is import that i can keep the range. So user does not have too change the range. For the moment it is a simple button to activate the sub.
Using Office 2016
All suggestions, solutions are appreciated.
Thx already
For the moment i use the code below to export a certain range from a sheet as pdf file in a folder "C:\Test.
This works fine but now i would like the possibility that the user can choose where he wants to save the file and with wich name.
Kind off like the basic "Save As" in Office.
It is import that i can keep the range. So user does not have too change the range. For the moment it is a simple button to activate the sub.
VBA Code:
'Sub ExportKlPilAsPDF()
'Create and assign variables
Dim saveLocation As String
Dim rng As Range
saveLocation = "C:\Test\myPDFFile.pdf"
Set rng = Sheets("Klassementen").Range("B1:G37")
'Save a range as PDF
rng.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=saveLocation
End Sub
Using Office 2016
All suggestions, solutions are appreciated.
Thx already