Helping millions of people navigate the world of technology.

How to Create a Print to PDF Button in Microsoft Excel on Windows 11

Quick Tips
  • You can turn your Excel file into a PDF with a click of a button.
  • You can create the button using the Quick Access Toolbar in Microsoft Excel.
  • You can also create the Print to PDF button using Marco Commands in Excel.

Create Print to PDF Button Using Quick Access Toolbar

The Quick Access toolbar available for Microsoft Office apps can also be used to enable the Print to PDF function in Microsoft Excel. You can print any file as a PDF. That said, you’ll need a PDF reader program like Adobe Acrobat Reader to open your PDF file and its layout properly.

Step 1: Open Microsoft Excel and then go to your spreadsheet.

Step 2: Click on File from the top-left corner and then select Options at the bottom-left menu.

Step 3: Click on the Quick Access Toolbar in the Excel Options window.

Step 4: Click the Popular Commands drop-down menu and then select All Commands.

all commands quick access toolbar settings excel

Step 5: Scroll down and select Publish as PDF or XPS.

Step 6: Click the Add button to copy the command. Then, click on Save at the bottom right side to confirm.

publish as PDF quick access toolbar excel

After you close the window, you will see the Print to PDF icon in the Quick Access Toolbar.

save as pdf quick access toolbar excel

Step 7: Click the icon after selecting the cells you want to be printed as the PDF.

Step 8: Enter the file name, select the location for saving your PDF file, and click on Publish.

Your Excel file will now open as a PDF in Adobe Acrobat Reader or whichever program you have installed on your Windows 11 PC to open PDF files. You can now print that file.

You can also read our post if the Quick Access Toolbar is not working in Excel on your PC.

Create Print to PDF Button Using Macro Commands in Microsoft Excel

A Macro Command Button lets you automate actions with a click. This advanced step requires you to enable the Developer Tab in Microsoft Excel. Here’s how.

Step 1: Open Microsoft Excel and then go to your spreadsheet.

Step 2: Click on File and then select Options at the bottom-left menu.

Step 3: Under Customize The Ribbon, scroll down to the bottom and enable the Developer tab. Then, click on Save at the bottom-right corner.

enable developer tab in MS Excel

After you enable the Developer tab in the Ribbon, here’s how to create a Macro Button for Print to PDF.

Step 1: Click the Developer tab at the top and then click on Insert.

Step 2: Select the icon for Command Button (ActiveX Control).

insert macro command button in Excel

That’ll insert a command button inside your Excel sheet.

Step 3: Right-click on the command button and select Properties.

properties command button excel

Step 4: Edit the Caption – the name of your macro command button. Name it something easy like Print to PDF.

Step 6: Close the Properties window, right-click on your command button again, and select View Code.

view code macro button Excel

Step 7: You will now see the Microsoft Visual Basic window. Copy the command and paste it into the Visual Basic window.

enter VBA for macro button MS Excel
Dim PrintFile As String PrintFile = Application.DefaultFilePath & "\" & _ ActiveWorkbook.Name & ".pdf" Sheets("Sheet1").Select ActiveSheet.PageSetup.PrintArea = "B7:E17" ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _ Filename:=PrintFile, Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, _ OpenAfterPublish:=True 

Do note that the VBA Sheets.Select statement has your sheet number that you need to print. You also need to specify the PrintArea by entering the selected cell numbers.

Step 8: Press Control + S to save the code. Close the Visual Basic window and then click the macro command button to print your Excel as a PDF file.

Enable permissions for Macro Buttons in Microsoft Excel.

Step 1: Click on File and then select Options at the bottom-left corner.

Step 2: Select Trust Center.

Step 3: Click on Trust Center Settings and then select Macro Settings.

Step 4: Click the checkbox next to Enable VBA macros, Enable Excel 4.0 macros when VBA macros are enabled, and Trust access to the VBA project object model.

enable VBA access for macro button Excel

Close the window, and your macro button should work now.

Was this helpful?

Thanks for your feedback!

Last updated on 28 May, 2024

Leave a Reply

Your email address will not be published. Required fields are marked *

The article above may contain affiliate links which help support Guiding Tech. The content remains unbiased and authentic and will never affect our editorial integrity.