Validating User Input to a Field
You can require any field, or any control that is bound to a field, to have a value. For example, you can set the exact text, range of numbers, or any other criteria for the field. You can also show a custom message (based on a validation formula) that tells users how to fill in the field if their entries don't match the value that you want. For example, you can limit the number of characters that can be entered in a TextBox.
For more information, see:
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.