• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need VBA for Partial Match Multiple Results

azumi

Active Member
Hi guys need help here for a vba or udf that can pull data in partial text, for clearly explanation please take a look at the file


thank you in advanced
Azumi
 

Attachments

Marc L

Excel Ninja
Hi, according to your attachment, a beginner starter event demonstration you must paste to the (Sheet1) worksheet module :​
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
        Dim L&, R&, S$(), V
    If Target.Address = "$A$8" Then
            L = 11
            Application.EnableEvents = False
            Cells(L, 1).CurrentRegion.Clear
        If Not IsEmpty(Target) Then
            Application.ScreenUpdating = False
        With [A1].CurrentRegion.Rows
            For R = 2 To .Count
                    S = Split(.Item(R).Cells(2).Text, "; ")
                    V = Application.Match("*" & Target.Text & "*", S, 0)
                If IsNumeric(V) Then
                   .Item(R).Copy Cells(L, 1)
                    Cells(L, 2).Value2 = S(V - 1)
                    L = L + 1
                End If
            Next
        End With
            Application.ScreenUpdating = True
        End If
            Application.EnableEvents = True
    End If
End Sub
Do you like it ? So thanks to click on bottom right Like !
 

azumi

Active Member
Awesome dude, thank you again, maybe i start learning VBA code soon as possible

Humble to your knowledge Marc
 
Top