Results 1 to 10 of 49

Thread: LookUp Value and Concatenate All Found Results

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    659
    Rep Power
    13
    Quote Originally Posted by snb View Post
    I was wondering whether this code could perform the same task (or am I ovrloooking something ?)

    Code:
    Function search_con_snb(sp As Range, c01 As String)
        sn = sp.Value
        For j = 1 To UBound(sn)
            c02 = c02 & "|" & Join(Application.Index(sn, j), "|")
        Next
        search_con_snb = Join(Filter(Split(c02, "|"), c01), "|")
    End Function
    sp is the range to look in
    c01 is the string to be looked for.
    | is the concatenation delimiter
    Our functions are quite different from each other. My function looks in a row or column and, if it finds a match, can return concatentations of values from a different range (sort of like how SUMIF works, but with text and concatenation rather than numbers and summation). Within that functionality, the UDF allows the user to control whether the search is case sensitive or not and whether the search should match the entire contents of the cells it searches or just find the text somewhere within the cell. It also allows you to filter the return list so that all items are returned from the ReturnRange or so that repeated items are listed only once. Also, the function allows the delimiter to be set by the user rather than hard-coding it into the body of the function.
    Last edited by Rick Rothstein; 07-06-2012 at 07:15 AM.

Similar Threads

  1. Replies: 5
    Last Post: 06-04-2013, 01:04 PM
  2. Replies: 6
    Last Post: 12-12-2012, 08:03 PM
  3. Lookup lookup lookup just can't make it work
    By work2live in forum Excel Help
    Replies: 1
    Last Post: 12-08-2012, 11:48 PM
  4. Excel found unreadable content
    By zyousafi in forum Excel Help
    Replies: 2
    Last Post: 08-08-2012, 10:41 AM
  5. Concatenate Multiple Lookup Values in Single Cell
    By Admin in forum Download Center
    Replies: 4
    Last Post: 04-06-2012, 09:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •