Error Alert

Define the error message that is displayed when invalid data is entered in a cell.

You can also start a macro with an error message. A sample macro is provided at the end of this page.

To access this command...

Choose Data - Validity - Error Alert tab.


Show error message when invalid values are entered.

Displays the error message that you enter in the Contents area when invalid data is entered in a cell. If enabled, the message is displayed to prevent an invalid entry.

In both cases, if you select "Stop", the invalid entry is deleted and the previous value is reentered in the cell. The same applies if you close the "Warning" and "Information" dialogs by clicking the Cancel button. If you close the dialogs with the OK button, the invalid entry is not deleted.

Contents

Action

Select the action that you want to occur when invalid data is entered in a cell. The "Stop" action rejects the invalid entry and displays a dialog that you have to close by clicking OK. The "Warning" and "Information" actions display a dialog that can be closed by clicking OK or Cancel. The invalid entry is only rejected when you click Cancel.

Browse

Opens the Macro dialog where you can select the macro that is executed when invalid data is entered in a cell. The macro is executed after the error message is displayed.

Title

Enter the title of the macro or the error message that you want to display when invalid data is entered in a cell.

Error message

Enter the message that you want to display when invalid data is entered in a cell.

Sample macro:

Function ExampleValidity(CellValue as String, TableCell as String)
Dim msg as string
msg = "Invalid value: " & "'" & CellValue & "'"
msg = msg & " in table: " & "'" & TableCell & "'"
MsgBox msg ,16,"Error message"
End Function