+ Reply to Thread
Results 1 to 5 of 5

VBA Code for Uppercase or Lowercase letters

  1. #1
    Registered User
    Join Date
    02-08-2013
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    12

    VBA Code for Uppercase or Lowercase letters

    I have code written to find certain text in column "Y", and return a value if it finds it. Sometimes the text I'm looking for is in uppercase letters and sometimes it is in lower case letters, although it's the same word. As you can see in this example, I currently have 2 code lines to find all the text. One line is searching for the test in upper case and one is to search the code in lower case. The code works fine, but it seems there should be code that looks for the text whether it's in upper or lower case. As you can see, first I search for all text containing "*TW Synergy*", and then I search for all text "*TW SYNERGY*". I would like to find code that looks for "Synergy" whether its in upper case or lower case and return the value ""Interconnect".

    Please Login or Register  to view this content.
    Can you help?
    Greg

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA Code for Uppercase or Lowercase letters

    Why not to turn cells value in upper case
    use
    Ucase(Cells(i, "Y")) like "*TW SYNERGY*"
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: VBA Code for Uppercase or Lowercase letters

    Try something like this:
    Please Login or Register  to view this content.
    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    02-08-2013
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: VBA Code for Uppercase or Lowercase letters

    Thanks PCI. This is what I did and it's doing what I need it to do now. Thanks.

  5. #5
    Registered User
    Join Date
    02-08-2013
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: VBA Code for Uppercase or Lowercase letters

    Thanks Ron. I went another direction and am working now. Thanks again for your reply.

+ 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. UPPERCASE to lowercase
    By ericinarcata in forum Excel General
    Replies: 7
    Last Post: 01-09-2012, 11:41 PM
  2. Uppercase = (This) Lowercase = (That)
    By uscoobyk in forum Excel General
    Replies: 4
    Last Post: 09-27-2010, 08:54 AM
  3. Changing Uppercase letters to lowercase
    By tubells in forum Excel General
    Replies: 4
    Last Post: 03-17-2010, 02:12 PM
  4. uppercase to lowercase
    By Missy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-03-2005, 06:06 PM
  5. [SOLVED] lowercase to uppercase
    By Louise in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-10-2005, 06:06 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