+ Reply to Thread
Results 1 to 5 of 5

InputBox that only allows text (<= 3 characters)

  1. #1
    Forum Contributor
    Join Date
    11-10-2011
    Location
    New York, NY
    MS-Off Ver
    MS Office: Excel 365
    Posts
    163

    InputBox that only allows text (<= 3 characters)

    Hi,

    I have an input box where the user has to input a column

    But i want an error to pop up if there's a number, or special character, or more than 3 characters (basically if the input value doesn't match a column)

    Could you help?
    Thanks!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: InputBox that only allows text (<= 3 characters)

    Cant put this into code for you, but it should be something like =and(len(A1)<=0,istext(a1))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: InputBox that only allows text (<= 3 characters)

    Can you provide the code you are using? I assume you mean an input box comes up during some code and you want to validate the input?
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: InputBox that only allows text (<= 3 characters)

    Since you mentioned an Input Box, is this part of userform? Perhaps this helps as well

    Please Login or Register  to view this content.

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: InputBox that only allows text (<= 3 characters)

    If it is a userform, it is just as easy to just prevent any entries that are not letters, but if it is a true InputBox then it is likely not in a form...


    xticnt, as you see we may need a bit more detail, but if my assumption about a true inputbox (which is called through code to request a value) is correct, you could try this:

    Please Login or Register  to view this content.

+ 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. Remove Text characters, leaving numerical characters
    By aschwalge in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-01-2016, 06:42 PM
  2. [SOLVED] Masked characters Inputbox
    By graphicgoose in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2014, 09:52 PM
  3. [SOLVED] Variable text/numbers between fixed text in in inputbox
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2013, 03:29 PM
  4. InputBox-ow to have a user input text in a inputbox
    By noodle48 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2011, 08:17 AM
  5. Show Inputbox characters as starts
    By LoveCandle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2009, 03:45 AM
  6. Dots, instead of characters in InputBox
    By Gabor in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-18-2007, 03:36 AM
  7. How do I restrict an inputbox to 5<= string characters?
    By Gabe Tiger in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2006, 02:08 AM

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