Here, we have five sheets of data but there are only three active sheets, and we want to print only those active sheets together. In the end, running the code will print multiple sheets ( Apparel-1, and Grocery) at one click. Here, Apparel-1, and Grocery are the name of the sheets. Worksheets(Array("Apparel-1", "Grocery")).PrintOut Likewise, in the previous method, to open the Visual Basic Editor, first go to the Developer tab on the ribbon > click on Visual Basic > from Insert > select Module > Now, write down the below VBA code.Basically, we are going to print some defined sheets with a VBA code. We can also print multiple sheets using the VBA Macros. Print Some Certain Sheets by Using VBA Code Then open the PDF file > press CTRL+P > then you can modify the page setup according to your need > after that press Print.ġ.4.Then you will get the PDF file, where each page of the PDF file will carry the data from each of the worksheets from the Excel workbook. While you are doing these, you will notice that all the sheets in your workbook are automatically selected. In our case, we named our new PDF file “ PrintAllSheet”. Now, press F5 on your keyboard > after successful code execution, you will be asked to select the folder where you want to save the PDF file > after selecting the new file path, click OK.IFile = InputBox("Enter New File Name", "PDF File Name")ĪctiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=iFolder & iFile, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True With Application.FileDialog(msoFileDialogFolderPicker) Now, copy and paste the VBA code that is shown below.įor Each iSheet In ActiveWorkbook.Worksheets.Go to the Developer tab > Visual Basic > Insert > Module.Simply just follow the below instructions. Here, we will convert the Excel file into a single PDF file by using the Excel VBA. Converting Excel File into PDF File with VBA Code to Print All Sheets After that, copy and paste the VBA code in Module > click on the RUN button to run the code.įinally, by running the code, we can easily print the entire workbook.ġ.3.Next, go to Insert and select Module from the drop-down menu.Another way to open the Visual Basic Editor is simply to press ALT+F11. First, go to the Developer tab on the ribbon > click on Visual Basic to open the Visual Basic Editor where we will write the VBA codes.For this, we need to follow the procedure down. We can use VBA Macros to print the entire workbook at once. Use of VBA Code to Print the Entire Workbook After that, from the Print option > go to the Settings drop-down menu > then select Print Entire Workbook > just click on the Print button.Īnd there you go! By following these instructions, you can print the entire workbook in just one go.ġ.2.First, go to the File tab on the ribbon or press CTRL+P.Here, we will use the Print Entire Workbook feature for printing all sheets at once. Using Print Entire Workbook Feature for Printing All Sheets at Once Below, we have explained four ways to do so.ġ.1. Suppose we have five sheets in our workbook, and we want to print all the sheets in one go. So, let’s have a look at all the different ways to print multiple sheets in Excel. Also, there are so many ways we can print Excel multiple sheets. Related Articles How to Print Multiple Sheets in Excel: 6 Suitable ExamplesĮxcel has a built-in feature with which we can print the whole workbook together.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |