+ Reply to Thread
Results 1 to 4 of 4

restrict second digit entered into text box to "8"

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    restrict second digit entered into text box to "8"

    In a userform text box I have restricted the entries to only digits but I also need to check that the second digit entered is "8"
    I have tried this in the text box change event

    Please Login or Register  to view this content.
    but it also reacts to the first entered entered digit because in that instance the second digit is blank

    Is there a way around this
    Help appreciated
    Last edited by nigelog; 08-22-2018 at 07:26 AM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: restrict second digit entered into text box to "8"

    May be

    If len(TextBox1.Value) = 8 Then

    end if

  3. #3
    Valued Forum Contributor kasan's Avatar
    Join Date
    07-22-2009
    Location
    Riga, Latvia
    MS-Off Ver
    Excel 2010
    Posts
    680

    Re: restrict second digit entered into text box to "8"

    Try to add additional criteria on how long number is entered:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: restrict second digit entered into text box to "8"

    @ kasan

    Perfect
    I had just tried
    Please Login or Register  to view this content.
    but wasnt right

    many thanks

+ 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. "Error" or "Disallow" Entries If Data Entered in Wrong Cell
    By sage.tx in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-12-2017, 12:20 PM
  2. "Text string you entered is too long" error when plot point clicked
    By RowanB in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-08-2015, 07:45 PM
  3. Replies: 1
    Last Post: 08-15-2014, 06:00 AM
  4. Replies: 0
    Last Post: 03-21-2014, 09:58 AM
  5. [SOLVED] Formula Needed to fill multiple cells with "No" when the word "No" is entered into a cell
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-09-2013, 05:36 PM
  6. [SOLVED] quick way to remove the "+" from engineering stations entered as text?
    By scuttlebutt95 in forum Excel General
    Replies: 4
    Last Post: 05-04-2012, 01:00 PM
  7. How can i copy value from "HTMLText"(EMBED("Forms.HTML:Text","")),using Macro
    By andrewyang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2010, 12:47 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