+ Reply to Thread
Results 1 to 7 of 7

First time String comparison using Like not working

  1. #1
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    First time String comparison using Like not working

    I have data in some cells in column B that look like Id# plus some number e.g
    Please Login or Register  to view this content.
    all the other cells have names FirstName LastName

    I need to find the cells that have Id# in them, I am trying te following, but not working


    Thanks

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    01-15-2016
    Location
    Dallas, TX
    MS-Off Ver
    2007
    Posts
    65

    Re: First time String comparison using Like not working

    Hi there,

    try to edit this line as follows:

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: First time String comparison using Like not working

    Try it without the #. This should work. Not sure how to use the like with #.

    I'll have a look


    click on the * Add Reputation if this was useful or entertaining.

  4. #4
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: First time String comparison using Like not working

    Hello Raymundus, something the code executes but nothing is found

  5. #5
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: First time String comparison using Like not working

    Hello tony h, that did the trix!

    Thanks

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,642

    Re: First time String comparison using Like not working

    To add deeper understanding - hash (#) for Like operator is equivalent to any digit. see https://msdn.microsoft.com/en-us/library/swf8kaxw.aspx

    So to find exactly such form Id# 13 but not Id 13 you may try for instance:
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  7. #7
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: First time String comparison using Like not working

    Thanks Kasper

+ 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] String Logic Comparison not working
    By Asepic in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-16-2015, 04:55 PM
  2. Excel 2007 : text string comparison
    By pedro4545 in forum Excel General
    Replies: 0
    Last Post: 10-21-2011, 11:33 AM
  3. String Comparison
    By tactical in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-13-2011, 01:15 PM
  4. Larger than ">" comparison not working when used with a string
    By sungsam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2009, 03:33 AM
  5. String comparison
    By HurricaneDan in forum Excel General
    Replies: 4
    Last Post: 11-08-2006, 02:05 PM
  6. comparison string VBA excell
    By stats in forum Excel General
    Replies: 5
    Last Post: 03-16-2006, 06:15 PM
  7. String Comparison
    By Purnima in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-08-2005, 08:06 AM

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