Skip to content

Latest commit

 

History

History
54 lines (33 loc) · 1.44 KB

Excel.PageSetup.PrintErrors.md

File metadata and controls

54 lines (33 loc) · 1.44 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PageSetup.PrintErrors property (Excel)
vbaxl10.chm473105
vbaxl10.chm473105
Excel.PageSetup.PrintErrors
4a864a1e-cbdb-8ef7-536d-d2c5f518f9db
05/03/2019
medium

PageSetup.PrintErrors property (Excel)

Sets or returns an XlPrintErrors constant specifying the type of print error displayed. This feature allows users to suppress the display of error values when printing a worksheet. Read/write.

Syntax

expression.PrintErrors

expression A variable that represents a PageSetup object.

Example

In this example, Microsoft Excel uses a formula that returns an error on the active worksheet. The PrintErrors property is set to display dashes. A Print Preview window displays the dashes for the print error. This example assumes that a printer driver has been installed.

Sub UsePrintErrors() 
 
 Dim wksOne As Worksheet 
 
 Set wksOne = Application.ActiveSheet 
 
 ' Create a formula that returns an error value. 
 Range("A1").Value = 1 
 Range("A2").Value = 0 
 Range("A3").Formula = "=A1/A2" 
 
 ' Change print errors to display dashes. 
 wksOne.PageSetup.PrintErrors = xlPrintErrorsDash 
 
 ' Use the Print Preview window to see the dashes used for print errors. 
 ActiveWindow.SelectedSheets.PrintPreview 
 
End Sub

[!includeSupport and feedback]