Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 1.1 KB

Excel.Validation.ShowError.md

File metadata and controls

45 lines (30 loc) · 1.1 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Validation.ShowError property (Excel)
vbaxl10.chm532087
vbaxl10.chm532087
Excel.Validation.ShowError
19f7e431-6a6a-d8ed-98fe-c931cfb95498
05/18/2019
medium

Validation.ShowError property (Excel)

True if the data validation error message will be displayed whenever the user enters invalid data. Read/write Boolean.

Syntax

expression.ShowError

expression A variable that represents a Validation object.

Example

This example adds data validation to cell A10 on worksheet one. The input value must be from 5 through 10; if the user types invalid data, an error message is displayed but no input message is displayed.

With Worksheets(1).Range("A10").Validation 
 .Add Type:=xlValidateWholeNumber, _ 
 AlertStyle:=xlValidAlertStop, _ 
 Operator:=xlBetween, Formula1:="5", _ 
 Formula2:="10" 
 .ErrorMessage = "value must be between 5 and 10" 
 .ShowInput = False 
 .ShowError = True 
End With

[!includeSupport and feedback]