+ Reply to Thread
Results 1 to 4 of 4

Control data entry in the userform

  1. #1
    Registered User
    Join Date
    09-18-2019
    Location
    Morocco
    MS-Off Ver
    2013
    Posts
    2

    Unhappy Control data entry in the userform

    Hello guys,

    I created a user form which is displayed when opening the excel file.
    I set conditions to ensure the completeness and correctness of data entered. The conditions are as follows:
    - All text boxes should not be blank (no issue with this one so far)
    - Text box1 ( name) : only text can be entered. If not display the message box ( I was stuck with this one ). You can refer to the code below ( for some reason I'm not able to enclose the file in the post)
    - Text box2 ( done by) : Initials should be entered. For instance JH for "John Smith" . The initials entered shoud be made up of at least 2 letters and capped to 3 letters.I used loop to display a message box until the condition is met but I failed)
    - Text box3 ( Date) : only date format is accepted ( I want to make sure no other info is filled )

    I'm a newbie on this field and I was stuck for some hours trying to figure out that by myself but now I'm seeking a solution for this challenge.

    Thanks in advance

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Control data entry in the userform

    Hello Excel addicted,

    Welcome to the Forum!

    I updated your code. Often times it is easier to validate inputs using event procedures than waiting till after everything has been input. I tested the code and it worked with no problems.

    Updated UserForm Code
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    09-18-2019
    Location
    Morocco
    MS-Off Ver
    2013
    Posts
    2

    Re: Control data entry in the userform

    Thank you very much Leith Ross ! I've looked through your code and I found it wisely compact. I adjusted the code to my specific need.
    Thanks again for your great help.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Control data entry in the userform

    Hello Excel Addicted,

    You're welcome. I am pleased to know you were able to understand and adjust the code without any problems. Good job!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1