+ Reply to Thread
Results 1 to 9 of 9

2 Letter Uppercase Entry Only

  1. #1
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    2 Letter Uppercase Entry Only

    Hello,

    Is there code to only allow to 2 letter entries in a column and keep them uppercase? This is for US States.

    Thank you,
    XJ

  2. #2
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: 2 Letter Uppercase Entry Only

    try this:

    Please Login or Register  to view this content.
    note that there is no state validation as you didn't ask for that. additional code is necessary to achieve that.
    Last edited by dmcgov; 12-13-2018 at 08:23 AM.

  3. #3
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    Re: 2 Letter Uppercase Entry Only

    Thank you for the code.

    It keeps popping up with message and can't get out. One popup to to next one.

  4. #4
    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,446

    Re: 2 Letter Uppercase Entry Only

    Try this:

    Please Login or Register  to view this content.
    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


  5. #5
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: 2 Letter Uppercase Entry Only

    where did you put the code? (it should be the codesheet that you are working on column A).

    i have tested the code and it does everything that you asked

  6. #6
    Banned User!
    Join Date
    10-12-2018
    Location
    Texas
    MS-Off Ver
    2010
    Posts
    358

    Re: 2 Letter Uppercase Entry Only

    Thank you TMS that works better. It functions without any popups. I also appreciate the help from you dmcgov.

    Cheers!

  7. #7
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: 2 Letter Uppercase Entry Only

    @tms, can you look at my code and see what i did wrong? it appears to run fine on my side without recurring popups.

  8. #8
    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,446

    Re: 2 Letter Uppercase Entry Only

    @dmcgov: seems to work OK for me. Maybe it's because you've used a Selection Change Event handler and it asks for input when you select a cell and then validates it. My code is a Change Event handler, so it only validates data when it is input (in column A).

    Perhaps it's just less intuitive forthe OP.

    Horses for courses, I guess.

  9. #9
    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,446

    Re: 2 Letter Uppercase Entry Only

    @xjohnson: You're welcome. Thanks for the rep.

+ 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. [SOLVED] Splitting Continuous Text Into Two Cells Using Uppercase Letter As Delimiter
    By Issi91 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-01-2017, 09:27 AM
  2. [SOLVED] VBA code to find first two uppercase letter in Column
    By toci in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-10-2016, 05:12 PM
  3. [SOLVED] Help fixing a code to enter only for words and the first letter of each word uppercase
    By eddyrcabrera79 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-09-2015, 04:10 PM
  4. Replies: 25
    Last Post: 04-21-2015, 10:19 AM
  5. [SOLVED] Convert first letter of every word to Uppercase . Not Proper casing
    By rampulaparthi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-27-2013, 04:46 AM
  6. [SOLVED] Finding an uppercase letter in a string parameter of a UDF
    By dredwolf in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-22-2012, 11:43 PM
  7. Determining Any Uppercase Letter
    By CrazyFileMaker in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-22-2009, 10:19 PM

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