How to only show print area in a worksheet in Excel?
For printing specified ranges only, you can set print areas (Page Layout > Print Area > Set Print Area) in Excel. In some cases, you may want to make only print area visible when sharing with your colleagues, how to get it done? In this article, I will intrude several methods to only show print area in a worksheet in Excel.
- Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
- More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
- Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
- Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
- Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
- Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
- More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.
When we show a worksheet in the Page Break view with clicking the View > Page Break Preview, non-printing area’s background will be changed to dark gray automatically. See below screen shot:
Note: You can also change to the Page Break Preview view with clicking the Page Break Preview button in the Status Bar.
However, this method will not hide the non-printing area, and you can still view the data in the non-printing area.
To hide non-printing area completely in Excel, you can try VBA macro. And you can do as follows:
Step 1: Press the Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.
Step 2: Click Insert > Module, and then paste following VBA code into the module window:
VBA: Only Show Print Area in Current Worksheet
Public Sub HideAllButPrintArea() Dim xPrintRng As Range Dim xFirstRng As Range Dim xLastRng As Range Application.ScreenUpdating = False With Application.ActiveSheet .Cells.EntireColumn.Hidden = False .Cells.EntireRow.Hidden = False If .PageSetup.PrintArea <> "" Then Set xPrintRng = .Range(.PageSetup.PrintArea) Else Set xPrintRng = .UsedRange End If Set xFirstRng = xPrintRng.Cells(1) Set xLastRng = xPrintRng.Cells(xPrintRng.Count) If xFirstRng.Row > 1 Then .Range(.Cells(1, 1), xFirstRng(-0, 1)).EntireRow.Hidden = True End If If xFirstRng.Column > 1 Then .Range(.Cells(1, 1), xFirstRng(1, 0)).EntireColumn.Hidden = True End If If xLastRng.Row < .Rows.Count Then .Range(xLastRng(2, 1), .Cells(.Rows.Count, 1)).EntireRow.Hidden = True End If If xLastRng.Column < .Columns.Count Then .Range(xLastRng(1, 2), .Cells(1, .Columns.Count)).EntireColumn.Hidden = True End If End With Application.ScreenUpdating = True End Sub
Step 3: Press F5 key or click the Run button to run this VBA macro.
Then you will see non-printing area is hidden at once, and only the print area is shown in current worksheet. See below screen shot:
- When there is only one print area in current worksheet, the VBA macro works well.
- This method does not support undo. To show non-printing area, you have to manually unhide the non-printing area, or apply Kutools for Excel’s Hide > Unhide All Ranges utility.
If you have Kutools for Excel installed, its Set Scroll Area utility will help you only show a print area in current worksheet easily.
Step 1: Select the print area in current worksheet.
Note: If you can’t find out the print area quickly, you can press F5 key to open the Go To dialog box, select the print area name and click the OK button as below screen shot shown. But this method will select all print areas in current worksheet.
Step 2: Click the Kutools > Show / Hide > Set Scroll Area.
Then you will see only the selected print area is shown in current worksheet at once as below screen shot shown:
- Kutools for Excel’s Set Scroll Area supports undo, and you can press the Ctrl + Z keys simultaneously to show hidden non-printing area.
- You can click Kutools > Show / Hide > Unhide All Ranges to show hidden non-printing area immediatelly.