Excel精英培训网

 找回密码
 注册

一对多模糊查找

已有 1559 次阅读2016-8-27 15:46

Function mylookup(myword As Range, mybook As Range, mycol As Integer)
Dim mysht As Worksheet
Set mysht = ActiveSheet
maxrow = mysht.UsedRange.Rows.Count
For i = 1 To maxrow
If myword.Value Like "*" & mybook.Cells(i, 1) & "*" Then
myresult = myresult & "," & mybook.Cells(i, mycol).Value
End If
Next
mylookup = Right(myresult, Len(myresult) - 1)
End Function
mybook查找范围的首列
 

评论 (0 个评论)

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-26 15:44 , Processed in 0.259465 second(s), 7 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

返回顶部