+ Reply to Thread
Results 1 to 4 of 4

Case Sensitive

  1. #1
    Registered User
    Join Date
    10-05-2004
    Location
    Scarborough, ON
    MS-Off Ver
    Mac Office 2019 v16.30 (19101301)
    Posts
    69

    Case Sensitive

    i am using "InStr(1, ActiveCell.Text, search)" code. how do i make the code so it is not case sensitive.

    example
    ActiveCell.Text = "The Malt Shoppe"
    search = "malt"

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Make your string lower case using LCase, and the search should also be in lcase

    InStr(1, LCase(ActiveCell.Text), LCase(Search))

    - Mangesh

  3. #3
    Registered User
    Join Date
    10-05-2004
    Location
    Scarborough, ON
    MS-Off Ver
    Mac Office 2019 v16.30 (19101301)
    Posts
    69
    ty very much, it worked perfectly

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Hemants,

    Here is a more direct way without coverting to lower case.

    InStr(1, ActiveCell.Text, search,vbTextCompare)

    Sincerely,
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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