+ Reply to Thread
Results 1 to 4 of 4

IsInArray to find exact match

  1. #1
    Registered User
    Join Date
    07-14-2013
    Location
    Grand Rapids, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    35

    IsInArray to find exact match

    So, I have a function created to check an array for matching values. The problem I'm having is that the function is finding a match for approximate values. For example, if I choose "Josh" and the values I'm checking against include just that text imbedded within them (ex. "Josheroni"), it's finding "Josheroni" as well as "Josh." I am trying to find a way to amend my existing code to only match exact values. Please help if you can. Code is below:

    Please Login or Register  to view this content.
    Last edited by Rokn; 03-14-2019 at 11:08 AM. Reason: Code is slightly incorrect

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,972

    Re: IsInArray to find exact match

    If the Ubound is > -1 then . you need to loop through the array and test each item, exiting if you find it.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,740

    Re: IsInArray to find exact match

    No need for the function, you can do it like
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: IsInArray to find exact match

    You could also do:
    Please Login or Register  to view this content.
    Though I'd loop, though not with a For Each, you're better looping through arrays by index

+ 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. add in the parameters to the Find function to only find an exact match.
    By jakeembx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-07-2014, 08:57 AM
  2. FIND function exact match
    By kgolding in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 12-13-2013, 10:41 AM
  3. [SOLVED] Problem with Find function. Need to find Exact match
    By SMILE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2012, 07:07 AM
  4. Find exact match in two collumn. Please help
    By 11ktran44 in forum Excel General
    Replies: 1
    Last Post: 02-23-2012, 04:00 AM
  5. Find exact match
    By indimonk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-30-2012, 11:25 PM
  6. Find exact match.
    By Robert.Cordani@us.schneider-electric.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2006, 12:55 PM
  7. Find a not exact match using vlookup
    By Russ B in forum Excel General
    Replies: 1
    Last Post: 07-27-2005, 04:05 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