Results 1 to 9 of 9

Add a special format to a textbox to work while typing

Threaded View

chin67326 Add a special format to a... 01-08-2016, 03:22 PM
6StringJazzer Re: Add a special format to a... 01-08-2016, 03:51 PM
chin67326 Re: Add a special format to a... 01-08-2016, 04:20 PM
6StringJazzer Re: Add a special format to a... 01-08-2016, 09:29 PM
chin67326 Re: Add a special format to a... 01-09-2016, 12:57 AM
chin67326 Re: Add a special format to a... 01-09-2016, 12:47 AM
chin67326 Re: Add a special format to a... 01-13-2016, 12:34 AM
6StringJazzer Re: Add a special format to a... 01-13-2016, 10:30 AM
chin67326 Re: Add a special format to a... 01-13-2016, 10:14 PM
  1. #1
    Forum Contributor
    Join Date
    06-07-2014
    Posts
    218

    Add a special format to a textbox to work while typing

    If you open the userform in the attached workbook, you will see a textbox with the word "OPERATOR". This word is fixed and cannot be deleted as per the code which enables it. After that word, the textbox has visible space for 7 more characters. This means that the word "OPERATOR" and 7 characters can be visible in the box at the same time.

    What I want is to have three numbers after the word, followed by a hyphen and then three further numbers. Therefore for example, I can have OPERATOR123-456 in the textbox. I want to have VBA that would format the box as the user types and automatically add the hyphen after the first three numbers perhaps. Finally, after the 6th number (i.e. the 7th character counting the hyphen) is entered, VBA code should prevent the user from entering any further characters in that box.

    I am not looking for an Exit routine as I would like the box to be formatted as one types.

    Any clue how to code this?
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel 2010 - Userform - display date from textbox in a label or textbox in 'ddd' format
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2015, 10:54 PM
  2. cant keep typing in userform textbox after change event
    By jed38 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-01-2014, 09:13 AM
  3. [SOLVED] Datepicker, textbox & cells date-format does not match for formula to work
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-02-2014, 10:04 AM
  4. unlock textbox for typing
    By Isabel Lopatin in forum Excel General
    Replies: 3
    Last Post: 01-31-2013, 12:33 PM
  5. Restricting typing of special characters
    By flakedew in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2012, 11:26 AM
  6. Apply currency format to textbox while typing
    By kuraitori in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-12-2012, 11:09 PM
  7. Stopping user from typing in textbox
    By dextras in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-04-2009, 06:49 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