+ Reply to Thread
Results 1 to 5 of 5

Restrictions in Text boxes values

  1. #1
    Registered User
    Join Date
    03-05-2016
    Location
    India
    MS-Off Ver
    6
    Posts
    16

    Question Restrictions in Text boxes values

    Hi,

    I have 2 text boxes to be included in VBA userform with a following criteria's.

    Text Box1: Please advice on how to code to accept spaces,hyphen in a text box but at the same time to restrict numbers.
    Text box 2: Other way accept numbers alone but not the spaces,alphabetic,hyphens(or any special characters).

    Please advice!

    Thanks.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Restrictions in Text boxes values

    Hi Mangai and welcome to the forum.

    For your first question, you've asked a very hard one. If you don't know anything about VBA or Userform properties this will a very hard problem. Let me point you to two websites that address this problem using code....
    http://gregmaxey.mvps.org/word_tip_p...ext_entry.html and
    http://www.mrexcel.com/forum/excel-q...textboxes.html

    My suggestion would be to NOT use a Userform and simply have the users type into normal Excel Cells. Then use the built in Validation tools that come in Excel.
    https://support.office.com/en-us/art...2-95b6aeeb73c9
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Restrictions in Text boxes values

    Mangai Venkata
    Try
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-05-2016
    Location
    India
    MS-Off Ver
    6
    Posts
    16

    Re: Restrictions in Text boxes values

    Thanks for the quick response..!

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Restrictions in Text boxes values

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. How to use Text Boxes values/text as Variabels in VBA code of UserForms
    By Giuseppe Jordão in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-13-2015, 10:39 AM
  2. [SOLVED] Text Boxes (Values) if blank equal to 0
    By Gomquai in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2012, 03:29 PM
  3. Replies: 2
    Last Post: 02-19-2010, 03:55 PM
  4. Grouping values by restrictions
    By patriko123 in forum Excel General
    Replies: 2
    Last Post: 06-04-2008, 02:09 AM
  5. Summing the values in text boxes
    By cosmic mo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2006, 01:20 PM
  6. Text Boxes and Default Values
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2005, 05:06 AM
  7. retrieving values from text boxes
    By medicenpringles in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2005, 04:03 AM

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