+ 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
    5

    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,258

    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
    5

    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,258

    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)

Similar Threads

  1. [SOLVED] Control data entry formats
    By PaulaGon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-27-2018, 11:51 AM
  2. [SOLVED] Code to control data entry in Combo-box situated in userform
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-05-2015, 10:15 AM
  3. Replies: 0
    Last Post: 02-04-2014, 12:36 AM
  4. [SOLVED] Userform multipage control exit events code execution not completed before next user entry
    By jane serky in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-10-2013, 04:39 AM
  5. Help with a worksheet control to govern column data entry ...
    By NikonMan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2013, 07:48 PM
  6. userform data entry
    By john tempest in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-06-2006, 10:45 AM
  7. [SOLVED] excel limit data entry range, control cursor movement to 2 cols
    By Bob in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2005, 01:05 PM

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