by Allen Wyatt
(last updated January 21, 2017)
Chris notes that Excel supports both Normal and Page Layout views. He wonders if there is a way to disable Page Layout view so the user of a workbook cannot select it.
Excel makes these two views (Normal and Page Layout) available from the View tab of the ribbon. One might think that the solution is to simply modify the user interface so that the Page Layout tool is no longer available on the ribbon. This, unfortunately, is easier said than done.
If you are using Excel 2007, the user interface is notoriously hard to change. It requires writing XML code and making sure that the code is executed every time the workbook is opened. If you like notoriously hard things, you can find a bit about how to start at this page:
If you are using Excel 2010 or a later version, then modifying the user interface is a bit easier. You can do it by following these steps:
Figure 1. The Excel Options dialog box.
That's it. Now, if you go look at the View tab, you'll notice that the user can no longer switch to Page Layout view. In fact, the user cannot pick any view other than whatever view you happen to be in at the current time. This change affects only the current machine, for all workbooks, and cannot be tied to any particular workbook. (The reason is that while you can modify the ribbons a bit in Excel 2010, you cannot modify them in macros. It's a big pain and you need to go back to writing XML code like in Excel 2007.)
Perhaps a better solution is to create a small macro that will make sure that the worksheet is always being displayed in Normal view. This is easy to do; just right-click on a worksheet tab and choose View Code from the resulting Context menu. In the code window, enter the following:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) ActiveWindow.View = xlNormalView End Sub
This code causes Excel to switch to Normal view every time someone changes what is selected on the screen. Someone could use the tools on the View tab of the ribbon to switch to Page Layout view, but as soon as they select a different cell the macro kicks in and switches back to Normal view.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12139) applies to Microsoft Excel 2007, 2010, 2013, and 2016.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Don't want to always type the decimal point as you enter information in a worksheet? If you are entering information that ...Discover More
Normally the Tab key can be used to move from one cell to another in Excel. If this cell movement doesn't work for you, ...Discover More
Excel can helpfully display some statistical information in the program's Status Bar. If you cannot see all the ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.