1
votes

I have id numbers on column A starts from A3 To A25. want to check each of the column A value with the F G H I columns values. In F G H I columns where data starts from 29th-row How do check with A column value with multiple columns values at a time?

lastrow = Range("A" & Rows.Count).End(xlUp).Row

lastrow1 = Range("F" & Rows.Count).End(xlUp).Row

For i = 3 To lastrow

    For j = 30 To lastrow1

        If Range("F" & j).Value = Range("A" & i).Value Or Range("G" & j).Value = Range("A" & i).Value Or Range("H" & j).Value = Range("A" & i).Value Or Range("I" & j).Value = Range("A" & i).Value Then
        End if

    Next j

Next i
1

1 Answers

1
votes

use below code. i have tested on your query

Please test it if any problem, feel free to contact.

Function allvlookup(rng As Range, rng1 As Range)

    Dim rng_r As Range
    Dim str As String


    For Each rng_r In rng1
        If rng = rng_r Then
            result = rng_r.Value
        End If
    Next rng_r

    allvlookup = result

End Function