作者:尚艺李波_387 | 来源:互联网 | 2022-12-04 17:29
我编写了一个脚本,用于比较工作簿中两个工作表之间的A列内容,以确定是否存在部分匹配.更清楚的是:如果表1中的库存A中的任何单元格的任何内容与表2中的库存A中的任何单元格的任何内容匹配那么那将是匹配并且脚本将在即时窗口中打印该内容.
这是我到目前为止的尝试:
Sub GetPartialMatch()
Dim paramlist As Range
Set paramlist = Sheets(1).Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
For Each cel In Sheets(2).Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
If InStr(1, cel(1, 1), paramlist, 1) > 0 Then 'I used "paramlist" here as a placeholder as I can't use it
Debug.Print cel(1, 1)
End If
Next cel
End Sub
事情是我不能使用这个的paramlist我的脚本中定义.我只是在那里用它作为占位符.