+ Reply to Thread
Results 1 to 5 of 5

Control the maximum of characters in a textBox

  1. #1
    Registered User
    Join Date
    04-17-2013
    Location
    Tunisia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Red face Control the maximum of characters in a textBox

    Hello friends,
    I wanted to know is there a vba code to control the number the caracters entered in a textBox?
    I mean for example I just want the user to enter a name in a textBox and this name should necessarly has at most 6 character.
    Is is possilble? how can I do that?
    Thank you very much

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    re: Control the maximum of characters in a textBox

    One way:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    re: Control the maximum of characters in a textBox

    Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  4. #4
    Registered User
    Join Date
    04-17-2013
    Location
    Tunisia
    MS-Off Ver
    Excel 2010
    Posts
    13

    re: Control the maximum of characters in a textBox

    Thnx I didn't know before how to make it Solved
    otherwise I found a simpler way to answer y question if you're interested.
    Actually when you select the TextBox, you go to property, then MaxLengh and you put the number of max characters you want in there.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    re: Control the maximum of characters in a textBox

    Thank you for sharing your solution ... sounds like the very thing you need

+ 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