• 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.

Partially Match Numbers

azumi

Active Member
Hello ninjas thanks for helping me all this time, but i need more help for this because im not that smart you know, thank you guys
 

Attachments

  • Need Help.xlsx
    10.1 KB · Views: 18
Maybe,

D2, Ctrl+Shift+Enter copied down :

=IF(LEN(B2)<>MIN(LEN(SUBSTITUTE(B2,MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),""))),"OK","KO")

Or,

=IF(COUNT(FIND(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),B2)),"OK","KO")

Regards
Bosco
 
Last edited:
Code:
Option Explicit

Sub foo()
    Dim lr As Long, i As Long
    lr = Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To lr
        If InStr(Range("B" & i), Left(Range("A" & i), 1)) > 0 Then
            Range("D" & i) = "OK"
        ElseIf InStr(Range("B" & i), Mid(Range("A" & i), 2, 1)) > 0 Then
            Range("D" & i) = "OK"
        ElseIf InStr(Range("B" & i), Mid(Range("A" & i), 3, 1)) > 0 Then
            Range("D" & i) = "OK"
        ElseIf InStr(Range("B" & i), Right(Range("A" & i), 1)) > 0 Then
            Range("D" & i) = "OK"
        Else: Range("D" & i) = "KO"
        End If
    Next i

End Sub
 
Back
Top