+ Reply to Thread
Results 1 to 3 of 3

userform textbox error trapping

  1. #1
    Registered User
    Join Date
    03-30-2011
    Location
    Los Angeles, Ca
    MS-Off Ver
    Excel 2003
    Posts
    8

    userform textbox error trapping

    Hello,
    I have a userforum with several textboxes in them. My first textbox asks for a phone number. I want the user to only be able to enter numbers and after the first 3 numbers it automatically adds in a "-" and again after the next 3 then stops them form entering more numbers after 4 more, so it looks like ### - ### - ####.

    I also have another textbox and I would like the user to be able to enter anyting except %&*@?:_-+= those symbols.

    Thanks,

    -Eric

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: userform textbox error trapping

    Try this,
    Please Login or Register  to view this content.
    The keypress code can be found here for additional details
    http://www.cpearson.com/excel/TextBox.htm

  3. #3
    Registered User
    Join Date
    03-30-2011
    Location
    Los Angeles, Ca
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: userform textbox error trapping

    Thanks Dave works like a charm

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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