Új hozzászólás Aktív témák

  • Mutt

    aktív tag

    válasz Roli78 #49119 üzenetére

    Szia,

    Tedd a lenti kódot egy modulba és lesz egy plusz függvényed (FindMatches), amely megszámolja hogy az első paraméterként megadott tartomány soraiban szerepel-e a második tartomány minden száma vagy sem.

    Function FindMatches(data As Range, val As Range) As Long
    Dim row As Long, col As Long
    Dim i As Long, j As Long
    Dim arrData, arrValues
    Dim strData As String

    arrData = data
    arrValues = val

    i = 0

    For row = 1 To UBound(arrData, 1)
    strData = "|"
    For col = 1 To UBound(arrData, 2)
    strData = strData & arrData(row, col) & "|"
    Next col

    j = 0

    For col = 1 To UBound(arrValues, 2)
    If InStr(1, strData, "|" & arrValues(1, col) & "|") > 0 Then j = j + 1
    Next col

    If j = UBound(arrValues, 2) Then i = i + 1
    Next row

    FindMatches = i

    End Function

    üdv

    A tanácsaimat ingyen adom. Ha nem tetszik, akkor kérlek ne kritizáld! / https://github.com/viszi/codes/tree/master/Excel

Új hozzászólás Aktív témák