If you have some specific hidden sheets in your Excel workbook, use the following code to print them: Sub print_hidden_sheet()įor Each working_sheet In ActiveWorkbook.WorksheetsĤ. PageSetup.PrintComments = xlPrintInPlace The following code will print sheets with comments: Sub print_sheets_with_comments()Īpplication.Displa圜ommentIndicator = xlCommentAndIndicator The following code will print the sheet “Dataset” exactly one page wide and tall. You can use all of these codes in your workbook. In the following sections, we are going to provide you with some very essential VBA macros that you can use in a lot of scenarios. Other Useful Macros to Print Sheets in Excel Read More: VBA Code for Print Button in Excel (5 Examples) In this way, you will print specific sheets with one button. Or you can use the macro of the previous two methods and use them in this button.In this way, you will be able to print any sheet you want. Copy the same button and paste it into all the worksheets.Now, from here, you can follow either of the two ways: This code will print the active sheet that you are working on. Now, double click on the button while Design Mode is on.As you can see, our print button is ready.From the Properties dialog box, change the caption of the button.To change the name of the button, right-click on the button.Now, place the button on your worksheet.After that, from the ActiveX Controls, click on the Button. ![]() ![]() Now, from the Controls group, click on Insert.First, go to the Developer If you don’t have it, enable the developer tab in the ribbon. ![]() Why is this helpful? We will use this because it is hazard-free. If you click that button, it will print specific sheets. After that, we will insert a code for that button. Now, another way to print specific sheets is to create a print button in Excel. Print Specific Sheets by a Button in Excel Worksheets(Array("Dataset", "AutoSum", "MIN", "SMALL")).PrintOutĤ. You have to enter the sheet names in the array like the following: Sub print_multiple_sheets() Now, you can use an array to print specific sheets.
0 Comments
Leave a Reply. |