About MrExcel
Consulting Services
Learn Excel Resources
Challenge of the Month
MrExcel Seminars

Message Board

MrExcel Store


GH asks "I'm facing a problem today, I have a user form with 5 different text boxes, 3 of those text boxes are mandatory. If I don't put nothing in one of those text boxes and I click the command button to perform the verification, I have a message box that appears and tells me that the text box "XXXX" is mandatory. When I click OK on this message box I would like my VBA project to select/activate the text box where data is mandatory."

Use the .SetFocus command:


By Bill Jelen on 14-Jan-2002 Consulting can be hired to implement this concept, or many other cool applications, with your data. provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures on this web site are provided "as is" and we do not guarantee that they can be used in all situations.


Excel is a registered trademark of the Microsoft® Corporation.

All contents Copyright 1998-2008 by MrExcel Consulting.