Results 1 to 4 of 4

IsInArray to find exact match

Threaded View

Rokn IsInArray to find exact match 03-14-2019, 11:02 AM
romperstomper Re: IsInArray to find exact... 03-14-2019, 11:26 AM
Fluff13 Re: IsInArray to find exact... 03-14-2019, 11:40 AM
Kyle123 Re: IsInArray to find exact... 03-14-2019, 12:16 PM
  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:

    Sub blah()
    
    Dim blahber As Variant, ron As String
    
    blahber = Array("Josh", "Josher", "Josheroni")
    
    ron = "Josh"
    
    For Each stuff In blahber
    
    if IsInArray(ron, blahber) then 
    msgbox stuff
    end if
    
    Next stuff
    
    End Sub
    
    
    Public Function IsInArray(stringToBeFound As String, arr As Variant) As Boolean
     IsInArray = (UBound(Filter(arr, stringToBeFound)) > -1)
    
    
    End Function
    Last edited by Rokn; 03-14-2019 at 11:08 AM. Reason: Code is slightly incorrect

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