|
本帖最后由 sky200801 于 2024-9-11 08:41 编辑
Function FindChildren(value, source As Object) As Object
Dim pro1 As Object
Set pro1 = CreateObject("scripting.dictionary")
Dim st As Object
Dim fpsno As String
Dim rows%
Set st = source
rows = st.Range("C65536").End(xlUp).row
For i = 2 To rows
fpsno = st.Cells(i, "A")
fpsno1 = st.Cells(i, "A")
If publicMethod.GetRegExp(fpsno, "^" & value & "(\.\d+)?$") = 1 And fpsno <> value Then
pro1.Add fpsno, i
ElseIf publicMethod.GetRegExp(fpsno1, "^" & value & "(\.\d+\.\d+)?$") = 1 And fpsno1 <> value Then
If Left(fpsno1, InStrRev(fpsno1, ".") - 1) = publicMethod.GetRegExp(fpsno, "^" & value & "(\.\d+)?$") And st.Cells(i, "E").value = "套" And st.Cells(i, "M").value = "" Then
pro1.Add fpsno1, i
End If
End If
Next
Set FindChildren = pro1
End Function
求助各位大神,根据图片,现在第一个IF算出了1.10.X这些编号,ElseIf算出了1.10.X.Y这些编号,第二个IF我是想让1.10.X.Y这个去掉.Y后的编号,然后E列=“套”,M列=“”,如果这些成立就将1.10.X.Y这些编号放入字典,问题点是:第二个IF的逻辑不成立。有没有什么好方法改下公式
|
评分
-
1
查看全部评分
-
|