Last week a client mentioned that he uses lots of message boxes in his Excel code, and finds that users just click OK when a message appears.
Most of the messages are informational, and users have read them before, so a quick click is fine.
Critical Messages in Excel
However, some of those messages are critical, and only appear when an important decision has to be made.
Because the users are so accustomed to seeing messages, they just click OK, without reading. That could cause problems!
For example, the Excel message shown below says:
- “Click OK to reformat your hard drive”
Busy office worker, clicking the OK button: “Sure, why not!”
Add Icon to Excel Message
I suggested that he add an icon to the critical messages, so they stand out from the rest.
Here’s the current code for this message.
Excel VBA Message Code Revised
To add a warning icon to the message, follow these steps:
- First, in the VBA message code, type a plus sign after vbOKCancel
- Next, in the drop down list of settings, select vbCritical
- Then, click the Save button, to save the code changes
Excel Message With Red X Icon
Now when the macro runs, the critical icon (red X) appears in the message.
That won’t force anyone to read the message, but the red X might catch their attention, and make them more likely to read it.