+ Reply to Thread
Results 1 to 7 of 7

Change UPPERCASE letters to lowercase based on a condition

  1. #1
    Registered User
    Join Date
    07-02-2014
    Location
    Prague
    MS-Off Ver
    2007
    Posts
    59

    Change UPPERCASE letters to lowercase based on a condition

    Hi guys,

    I am currently dealing with a xls file from a supplier that contains different uppercase character distribution than I need. I figured it would take a lot of time for human to manually rewrite it so if it can be done by Excel VBA, it would save me a lot of time.

    What I am talking about:

    1) the column "C" consists of product names

    2) Now the uppercase characters are distributed this way: Great Apple Pie For Two People QCS653

    3) I need it to be: Great apple pie for two people QCS653

    So the VBA should be able to keep only the first letter uppercase and transform all the following characters to lowercase. However, it should also check if there is a product code (several uppercase characters followed by a number) and keep the product code uppercase. The product codes can be in this format: QCS653, T1000, 5653T

    Can it be done using VBA?

    Any help would be appreciated.

    Thank you.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Change UPPERCASE letters to lowercase based on a condition

    Does the product code always contain a number?
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Registered User
    Join Date
    07-02-2014
    Location
    Prague
    MS-Off Ver
    2007
    Posts
    59

    Re: Change UPPERCASE letters to lowercase based on a condition

    Quote Originally Posted by kev_ View Post
    Does the product code always contain a number?
    Hi Kev,

    yes, the product code always contain a number, sometimes it does not contain any letter though (for example 65302)

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Change UPPERCASE letters to lowercase based on a condition

    Try this - puts the amended values in column D so that you can see them side by side

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Change UPPERCASE letters to lowercase based on a condition

    Maybe:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 05-16-2017 at 12:01 PM.

  6. #6
    Registered User
    Join Date
    07-02-2014
    Location
    Prague
    MS-Off Ver
    2007
    Posts
    59

    Re: Change UPPERCASE letters to lowercase based on a condition

    Quote Originally Posted by kev_ View Post
    Try this - puts the amended values in column D so that you can see them side by side

    Please Login or Register  to view this content.
    Works absolutely beutifully. Thank you!

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Change UPPERCASE letters to lowercase based on a condition

    Glad it does what you want.
    Please mark thread as SOLVED (see Thread Tools at top of thread)

+ 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] VBA Code for Uppercase or Lowercase letters
    By gbloemke in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-26-2014, 10:37 AM
  2. [SOLVED] Change lowercase letters to upper-case
    By royalB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2014, 11:36 AM
  3. Changing Uppercase letters to lowercase
    By tubells in forum Excel General
    Replies: 4
    Last Post: 03-17-2010, 02:12 PM
  4. Replies: 9
    Last Post: 06-15-2006, 07:40 PM
  5. [SOLVED] change from lowercase to uppercase
    By Henry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2006, 04:20 PM
  6. [SOLVED] How do I do a global change from uppercase to lowercase?
    By Instrument Guy in forum Excel General
    Replies: 2
    Last Post: 02-17-2006, 04:25 PM
  7. CHANGE WHOLE EXCEL worksheet TO UPPERCASE LETTERS?
    By mineralgirl in forum Excel General
    Replies: 4
    Last Post: 09-02-2005, 09:05 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