+ Reply to Thread
Results 1 to 7 of 7

Case insensitive search strings

  1. #1
    Registered User
    Join Date
    10-05-2010
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    9

    Case insensitive search strings

    I use the below macro (thanks Dave Peterson) to format specific words in a range of Excel cells.

    I would like to make the search terms (myWords) case insensitive and I've tried using MatchCase, but apparently I'm using it incorrectly or in the wrong place.

    Can someone help?



    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    2016 & 365 Sub
    Posts
    730

    Re: Case insensitive search strings

    Maybe try swapping:
    Please Login or Register  to view this content.
    For
    Please Login or Register  to view this content.

  3. #3
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    1,944

    Re: Case insensitive search strings

    The Find method is case insensitive by default so your macro should work "as-is". Can you attach a sample so we can see why it's not working?

    WBD
    Office 365 on Windows 11, looking for rep!

  4. #4
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,445

    Re: Case insensitive search strings

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    2016 & 365 Sub
    Posts
    730

    Re: Case insensitive search strings

    From what i have found, if you do not declare case sensitive part within the Find statement then VBA Find will default to whatever the last manual options were. If your last manual Find was case sensitive then your next VBA Find will be unless you declare otherwise.

    This is why i have included the True in the case sensitive part of the Find.

    Please Login or Register  to view this content.

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    2016 primarily
    Posts
    7,332

    Re: Case insensitive search strings

    Find's case sensitivity is also dependent on any other finds that have been done in the current session of Excel. However, you also need to alter this part:

    Please Login or Register  to view this content.
    to something like:

    Please Login or Register  to view this content.
    Rory

  7. #7
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    1,944

    Re: Case insensitive search strings

    I made a couple of tweaks:

    Please Login or Register  to view this content.
    WBD

+ 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. Replies: 15
    Last Post: 07-27-2017, 08:18 AM
  2. [SOLVED] Cell's insensitive for upper lower letter case
    By Juolupuki in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-13-2017, 07:21 PM
  3. case insensitive advanced filter?
    By bluphoto in forum Excel General
    Replies: 4
    Last Post: 03-02-2015, 10:14 AM
  4. [SOLVED] Use Like to Find a String that is Case Insensitive
    By Excel Guy 123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2014, 02:28 PM
  5. How to make case insensitive within a MACRO
    By andreadouglas26 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-05-2012, 01:16 PM
  6. Case insensitive search for string within folder of excel files
    By vba_novice in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-22-2011, 11:21 PM
  7. [SOLVED] VBA and Case Insensitive
    By robin.coe@gmacinsurance.com in forum Excel General
    Replies: 2
    Last Post: 03-09-2006, 01:35 PM

Tags for this Thread

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