AlertStyle Property

Microsoft Excel Visual Basic

Returns the validation alert style. Read-onlyXlDVAlertStyle.

XlDVAlertStyle can be one of these XlDVAlertStyle constants.
xlValidAlertInformation
xlValidAlertStop
xlValidAlertWarning

expression.AlertStyle

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

Use the Add method to set the alert style for a range. If the range already has data validation, use the Modify method to change the alert style.

Example

This example displays the alert style for cell E5.

MsgBox Range("e5").Validation.AlertStyle