Page orientation can be important when planning to print your work in Excel.
While the default page orientation in Excel is the Portrait mode (where the length of the page is more than the width), if you have a data set where there are more columns than rows, you may want to change the orientation to Landscape.
In this tutorial, I will show you some easy ways to change page orientation in Excel.
This Tutorial Covers:
ToggleChange Page Orientation Using the Page Layout Tab
The easiest way to change the page orientation of your worksheet in Excel is by using the Orientation option in the Page Layout tab.
Below are the steps to change the Page orientation:
- Activate the worksheet for which you want to change the page orientation.
- Click the Page Layout tab.
- In the Page Setup group, click on the orientation option.
- Select the page orientation you want (Portrait or Landscape)
Note: The current page orientation is highlighted in gray color in the Orientation drop-down
Once you have set this orientation, this will be used when you print your worksheet.
Page orientation is a worksheet-specific setting. This means that if you change the page orientation in one of the worksheets, it will only be applied to that worksheet, and all the other worksheets in the workbook will remain unchanged.
Change Page Orientation Using Keyboard Shortcut
If you are a keyboard shortcut aficionado like me, here’s a keyboard shortcut to change the page orientation in Excel:
ALT + P + O + Arrow Keys + Enter
Using ALT + P + O (press these keys one after the other) would take you to a position where you will see the landscape and the portrait mode in the Orientation drop-down.
Then you can use the arrow key to select the orientation you want and then hit the Enter key to apply it.
Change Page Orientation Using Print Preview
You can also change the page orientation setting while printing your data.
This can be done using the Print Preview window that opens where you specify the print and printer settings.
Below I have this data set that I want to print in landscape mode.
Here are the steps to change the print orientation through the print preview window:
- Activate the worksheet that you want to print in the landscape mode
- Click the File tab and then click on the Print option to open the Print Preview window. You can also use the shortcut Control + P
- Click the Orientation option.
- Select the Page orientation you want to use for this print job. In this case, I will go with Landscape mode (as I have more columns than I want to print all of them in one single sheet)
Change Page Orientation Using Page Setup Dialog Box
Another way to change the page orientation in Excel is by using the Page Setup dialog box.
While this is not the fastest way to do this, in case you want to change a couple of settings in the Page Setup dialog box, you can use this method to change the orientation as well.
Below are the steps to do this:
- Click the Page Layout tab.
- In the Page Setup group, click on the dialog box launcher (that small titled arrow at the bottom right of the group). This will open the Page Setup dialog box.
- Select the Page tab (if not selected already)
- Select the Orientation by selecting the option button (radio button).
- Click OK
Note: You can also open the Page Setup dialog box using the keyboard shortcut ALT + P + S + P (press these keys one after the other)
Change Page Orientation of All Worksheets Using VBA
As I mentioned earlier, when you set the page orientation for a worksheet, it is only applied to that specific worksheet and not to other worksheets in your workbook.
But what if you want to change the page orientation of all the worksheets in the workbook?
One way would be to do it manually one by one for each worksheet, but that could be time-consuming in case you have a big workbook with a lot of worksheets.
Let me show you a very simple VBA technique to quickly change the page orientation of all the worksheets in your workbook.
Here are the steps to use VBA to change the page orientation to landscape for all worksheets in the workbook:
- Open the workbook where you want to change the page orientation
- Click the Developer tab and then click on the Visual Basic icon. It will open the VB editor where we are going to put our code.
In case you do not see the Developer tab, you can also use the keyboard shortcut ALT + F11 (hold the Alt key and then press the F 11 key).
- In the VB Editor, if you do not see the Immediate Window, click on the View tab and then click on the Immediate Window option. You can also use the keyboard shortcut Control + G
- Copy and paste the following line of VBA code into the immediate window
For each ws in Worksheets: ws.PageSetup.Orientation = xllandscape: Next ws
- Place the cursor at the end of the line
- Press the Enter key
- Close the VB Editor
As soon as you press the enter key in step 6, the code is executed, and the page orientation of all the worksheets is set to landscape mode.
In case you want to set the orientation to Portrait instead, you can use the below VBA code in the immediate window and follow the same steps:
For each ws in Worksheets: ws.PageSetup.Orientation = xlPortrait: Next ws
So these are some of the ways you can use to change the page orientation of your worksheets in Excel.
The easiest way to do this is by using the option in the Page Layout tab in the ribbon in Excel or using the orientation option in the Print Preview window.
You can also do this using the Page Setup dialog box in case you are changing multiple page settings.
And in case you have a lot of worksheets, and you want to change the page orientation for all the worksheets in the workbook, you can use the VBA method.
Other Excel articles you may also like: