Do you need to change the orientation of an Excel worksheet for printing purposes but don’t know how? Read this quick tutorial to learn how to change page orientation in Excel in various ways.
Let’s say you created a sales report and need to print it on paper sheets and PDFs to distribute among various business stakeholders and investors. If you try to print the Excel spreadsheet as is, you’ll find that the printed document has less data per sheet of paper, and also the report seems hard to read. Not to mention, you’ll discover that most rows and columns are incomplete.
However, if you know the different page layout options of Excel and apply the right one before printing, you can avoid such problems.
Keep reading to discover various methods to change page orientation and choose the right one for you in Excel.
Reasons to Change Page Orientation in Excel
- Fit more data on a single page and minimize the need for excessive scrolling.
- Enhance the readability of text-heavy documents and improve overall legibility.
- Maintain consistency with other documents, ensuring a cohesive and professional appearance.
- Facilitate easy sharing and printing, as portrait orientation is the default setting for most printers and paper sizes.
- Adhere to industry standards or guidelines that require documents to be presented in a specific orientation.
- Optimize data presentation, especially for wide tables, charts, or graphs.
- Create customized reports with visually appealing layouts.
- Accommodate large worksheets by utilizing landscape orientation.
- Improve the accuracy and appearance of printouts, avoiding data truncation or distortion.
- Enhance data analysis by aligning the page orientation with the type of analysis being conducted.
Change Page Orientation on the Page Layout Tab
The Page Layout tab on the Excel ribbon provides various standard page setup options should you need to print the worksheet or workbook. Among those settings, one is Orientation. Here’s how to use this setting:
- On your Excel worksheet, click the Page Layout tab on the ribbon menu.
- Click the Orientation command and choose Portrait or Landscape.
- The Portrait orientation allows you to accommodate more rows, whereas Landscape lets you include more columns but fewer rows.
Page Setup Dialog Box to Change Page Orientation
Do you love to use various Excel shortcut keys to escape manual clicks and navigation? Then, try the following steps to modify the orientation of the printable page area on Excel:
- Suppose, you’re on the Home tab of your Excel worksheet.
- Press Alt and then press H > P > S+P to bring up the Page Setup dialog box.
- On this window, you should see the Orientation option with Portrait and Landscape under the Page tab.
- Choose the one you need and hit OK.
- You’ll see a dotted line (horizontal for Landscape and vertical for Portrait) demarcating the printable area on the worksheet.
You should modify the Excel worksheet so that the content comes within the demarcated zones. This ensures your report data will be within the entire page. If there is more than one page worth of data, you’ll see more pairs of dotted lines as you scroll down the worksheet.
Change the Orientation of Excel Pages While Printing
If you don’t want any distraction on the Excel worksheet like a dotted line when working on data analysis and visualization, you can change the orientation before printing the report. Here’s how:
- Once you’re ready to print the Excel report, hit Ctrl + P keys on the keyboard.
- This should open the Print Preview tool of Excel.
- There, under the Settings section, you should see Landscape Orientation.
- Click the drop-down menu to choose Portrait Orientation.
- Accordingly, the preview will change and show the printable area.
- If the print preview doesn’t look good, click the back arrow to go to the Home tab.
- Now, adjust the rows and columns to fit the content within the dotted line.
- Give the print command again and now the preview should be okay.
By default, all Excel worksheets are in the Landscape Orientation in the Print Preview tool. You must change that to Portrait if you need to change the default selection.
Modify the Excel Page Orientation for Multiple Worksheets
Suppose, there are multiple worksheets in your Excel workbook. You want to switch all these to the Portrait orientation for printing purposes. Here’s how you can accomplish that:
- Click Ctrl and select all the worksheets in the Excel sheets menu at the bottom of the software.
- Now, click the Page Layout tab and choose any page orientation from Landscape and Portrait.
- Browse individual worksheets and you should see all of them are in the selected page orientation.
Create an Excel Template for Altered Page Orientation
If you use an Excel template, you no longer need to change the orientation of each Excel worksheet before printing. All you need to do is open the template, copy fresh data, and print the workbook or selected worksheets.
You already have an Excel file with an altered page orientation. Find below the steps to save the file as a template:
- Click the File tab and choose Save As.
- Now, select Browse under the Save As section on the right side.
- On the Save As dialog box, choose a destination directory for the new file.
- Now, click the Save as type drop-down list and choose the Excel Template (XLTX) file type.
- Click the Save button to complete the process.
When you need to use the template, go to the destination where you saved it and open the file. Make the necessary changes like importing new data or updating an existing chart. Click Ctrl + S to save the file as a different one. Now, simply print the content and you get the previously set page orientation.
Changing Excel Page Orientation Using a VBA Script
Let’s consider you want to automate the page orientation changing process in Excel. For that, you can use the following VBA script. The script converts page orientation to Portrait if the existing orientation is Landscape and vice versa. Here are the steps to create and run the macro:
Also read: How To Use The VBA Code You Find Online
- Hit Alt + F11 to bring up the Excel VBA Editor tool.
- Click Insert and choose Module in the VBA Editor toolbar.
- Copy and paste the following script into the blank Module:
Sub TogglePageOrientation()
If ActiveSheet.PageSetup.Orientation = xlLandscape Then
ActiveSheet.PageSetup.Orientation = xlPortrait
Else
ActiveSheet.PageSetup.Orientation = xlLandscape
End If
End Sub
- Click the Save button and close the VBA Editor tool.
- Now, press the Alt + F8 keys together to open the Macro dialog box.
- There, choose the TogglePageOrientation macro and hit the Run button to run the VBA macro.
- Excel will automatically change the page orientation to Portrait if it’s in Landscape and vice versa on the active worksheet.
You could also attach this small script to your VBA project. Thus, when you execute the parent macro, Excel will process all the tasks and finally set the desired page orientation. Thus, you can go directly to the Print Preview page by pressing the Ctrl + P keys. No need to manually execute an extra VBA macro.
How to Change Page Orientation in Excel Using Office Scripts
If you’re using the Excel for Microsoft 365 desktop app or the Excel web app, you can use Office Scripts for advanced automation. However, there must be an active Microsoft 365 subscription in your account. If you see the Automate tab in your Excel web app or desktop app, you can use this to convert the page orientation in Excel. Here’s how:
- Click the Automate tab and select the New Script button.
- The Code Editor tool will pop up on the right side of the Excel app.
- There, delete the existing code and then copy and paste the following script:
function main(workbook: ExcelScript.Workbook) {
let selectedSheet = workbook.getActiveWorksheet();
// Set print area for selectedSheet to range "A1:I31"
selectedSheet.getPageLayout().setPrintArea("A1:I31");
// Set ExcelScript.PageOrientation.portrait orientation for selectedSheet
selectedSheet.getPageLayout().setOrientation(ExcelScript.PageOrientation.portrait);
// Set Letter paperSize for selectedSheet
selectedSheet.getPageLayout().setPaperSize(ExcelScript.PaperType["Letter"]);
// Set No Scaling scaling for selectedSheet
selectedSheet.getPageLayout().setZoom({scale: 100});
}
- Click the Save script button and then hit the Run button on the Code Editor tool.
- By doing so, you can change the orientation of a page in Excel from Landscape to Portrait.
If your Excel worksheet is in the Portrait orientation already and you need the Landscape orientation change all the occurrences of portrait
to landscape
.
You can include this Office Scripts code in your existing project. Thus, running the parent script will do all the tasks that you coded into the script and set page orientation to either Portrait or Landscape automatically.
Conclusion
These are all popular ways to change page orientation in Excel. You can use the Page Layout tab, Page Setup dialog box, or the Print Preview tool to manually set an appropriate page orientation.
Suppose, your worksheet has VBA or Office Scripts-based automation, you can include the given VBA scripts and Office Scripts codes to make the page orientation selection process automated.
Do you know any other tips for setting the page orientation? Let me know in the comments below!
0 Comments