![]() ![]() IgnorePrintAreas:=False for using the print areas, and openafterpublish:=True to open the file after creation is used.Īfter saving the code, return to the main sheet. Then, we have put 0 as the Type for printing this range as PDF and as a Filename, we have declared the path and set the file name PDF.įurthermore, the properties Quality:=0 for standard quality, and IncludeDocProperties:=False for ignoring the document properties. Here, we have declared the function range_to_pdf as Boolean and the function takes an input defined_rng as Range.įor printing this input range, we are using the ExportAsFixedFormat method. Function range_to_pdf(defined_rng As Range) As Boolean Here, we will create a function with the help of a VBA code, using this function we will select the range to print this range as PDF and this function will give us a boolean value in the Print column. Read More: Excel VBA to Print As PDF and Save with Automatic File NameĬase-3: Using Function to Print Range to PDF When you will open the printed file named PDF then you will see the following range in PDF format. ➤ Select the range which you want to print and press OK in the Input Box.įinally, we are having the printed PDF file in our defined location. IgnorePrintAreas:=False for using the print areas, and openafterpublish:=True to open the file after creation. In addition to this, we are using the further properties Quality:=0 for standard quality, and IncludeDocProperties:=False for ignoring the document properties. Then, we have put 0 as the Type for printing this range as PDF and as a Filename, we have declared the path and set the file name PDF. To print this range we are using the ExportAsFixedFormat method. Here, we have declared defined_rng as Range and then set it with the range which we will select after the appearance of the Input Box, and for this Input Box, we are using the InputBox method. "Choose the Specific Range", Title:="Microsoft Excel", Type:=8)ĭefined_rng.ExportAsFixedFormat Type:=0, _įilename:="C:\Users\Mima\Downloads\"
0 Comments
Leave a Reply. |