|
With ListView1
.ListItems.Clear
text_box = "/" & UserForm1.TextBox1.Text & "/"
For i = 1 To Len(text_box)'记录节点"/"并记录到数组内
If Mid(text_box, i, 1) = "/" Then
num_jd = num_jd + 1
ReDim Preserve arr_jd(1 To num_jd)
arr_jd(num_jd) = i
End If
Next
For i = 1 To UBound(arr_jd) - 1'遍历节点"/",以此提取条件字符
ReDim Preserve arr_text(1 To UBound(arr_jd) - 1)
arr_text(i) = Mid(text_box, arr_jd(i) + 1, arr_jd(i + 1) - arr_jd(i) - 1)
Next
For i = 1 To UBound(arr_zb)
strSearchText = arr_zb(i, 2) & "/" & arr_zb(i, 3) & "/" & arr_zb(i, 4) & arr_zb(i, 5) & arr_zb(i, 7) & arr_zb(i, 9) '设置检索多条件查找
For X = 1 To UBound(arr_text)'遍历条件
If InStr(1, strSearchText, arr_text(X), vbTextCompare) Then'记录多条件满足次数
num_bj = num_bj + 1
End If
Next
If num_bj = UBound(arr_text) Then'若满足次数与多条件数一致,表明模糊匹配全部多条件
。。。。。
以下就是和楼主代码一致了(我修改成自己适用代码了,所以不显示了哈) |
|