Archive of Mr Excel Message Board

Back to Errors in Excel archive index
Back to archive home

Customizing error messages
Posted by James on August 20, 2001 4:39 AM
I have protected a selection of cells in a worksheet. Therefore when I try to enter anything in to any of these cells, I get the standard error message about "The cell or chart you have tried to change is protected. ...." Is there any way to customize or change this error message to something of my choosing, using VBA?

Re: Customizing error messages
Posted by Alix on August 20, 2001 6:18 AM
Hi James
Not sure about doing this in VB, but there is a way of doing it with conditional formatting.
Highlight your range
Go to : Data | Validation
choose 'Custom' from the drop-down at 'Allow'
Enter the formula:
=""
You can then set your own message on the Error Alert tab.
When a user enters a value in the range, the error alert will appear when they hit enter/tab and the cell will revert to its original value
HTH
Alix

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.