Change Case Of Cells Based On Text Length

  • Is there a way to change the text in a cell to proper apart from 2/3 letter words which I want to keep as upper?


    Basically can it ignore all words that are 2 or 3 letters long, but change all other words to proper text?



    thanks[hr]*[/hr] Auto Merged Post;[dl]*[/dl]Oh, and this will done over a one column, which is always being added to.

  • Re: Change Text To Proper Case But Keep 2&3 Letter Words As Upper


    Hi trebormint,


    Maybe something like this:



    The function fProper converts any string passed to it into Proper Case, except for 2 and 3 letter words. You can either call it from your macro or use it as a worksheet function.


    The sub loopProper is just an example how you might use this in your own macros to loop through a number of cells and convert them all.

  • Re: Change Text To Proper Case But Keep 2&3 Letter Words As Upper


    THanks that works really well :)


    Is there any chance it can ignore words starting with or ending with numbers as well?


    i.e. 300MWB or MY04

  • Re: Change Text To Proper Case But Keep 2&3 Letter Words As Upper


    try

    p45cal

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!