[英]VBA Code to Check one Column Data with Multiple Columns Data?
I have id numbers on column A starts from A3 To A 25. I want to check each of the column A value with the F G H I columns values.我在A列上的 ID 编号从A3到A 25。我想用F G H I列值检查A列的每个值。 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?
在数据从第 29 行开始的F G H I列中,如何一次检查具有多个列值的A列值?
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
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.