Results 1 to 18 of 18

Thread: Split words in each cell in range and compare to see if in another range

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Apr 2013
    Posts
    4
    Location

    Split words in each cell in range and compare to see if in another range

    Hi Guys ,
    What i'm trying to do is loop through my range eg: K15:K150 which is made up of comma seperated words and check each word in the cell against a name in another range B15:B150, if it's there ill save its address in another Range (Z) so i have a cell of adresses for that cell it was checking.
    so
    [VBA]VB:
    Col B ColK ColZ

    Jon Rick,Ben B4,B5
    Dave
    Rick Jon,Dave B2,B3
    Ben
    Todd Jon B2
    [/VBA]
    I only started splitting strings for single cell, so wouldn't really be of help to you guys here
    but was trying to adapt:
    [VBA]VB:
    Sub SplitValue()
    Dim LookInHere As String
    Dim Counter As Integer
    Dim SplitCatcher As Variant
    LookInHere = Range("K15").Value
    SplitCatcher = Split(LookInHere, ",")
    For Counter = 0 To UBound(SplitCatcher)
    If SplitCatcher(Counter) = Range("B15:B150").Text Then
    'get address and store in Z
    End If
    Next
    End Sub [/VBA]

    any ideas guys
    Last edited by Aussiebear; 05-29-2013 at 04:06 PM. Reason: setting out better

Posting Permissions

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