javascript:;
[attach]34432[/attach][attach]34432[/attach][attach]34432[/attach][attach]34432[/attach]

Sub test()
Dim Arr, xD, T\$, pos%
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([j5], [g65536].End(3))
For i = 2 To UBound(Arr)
T = Arr(i, 1) & "|" & Arr(i, 2)
xD(T) = Array(Arr(i, 3), Arr(i, 4))
Next
Arr = Range([d1], [a65536].End(3))
For i = 2 To UBound(Arr)
T = Arr(i, 1) & "|" & Arr(i, 3)
If xD.Exists(T) Then
pos = InStr(xD(T)(0), Arr(i, 2))
If pos = 0 Then
Arr(i, 4) = "錯誤，因為" & Arr(i, 1) & "+" & Arr(i, 3) & "，儲位" & xD(T)(1)
Else
Arr(i, 4) = "正確，因為" & Arr(i, 1) & "+" & Arr(i, 3) & "，儲位" & xD(T)(1)
End If
End If
Next
Range("a1").Resize(UBound(Arr), 4) = Arr
End Sub

https://blog.xuite.net/hcm19522/twblog/590142590

Sub test2()
Dim Arr, xD, T\$, pos%, a, i&
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([j5], [g65536].End(3))
For i = 2 To UBound(Arr)
T = Arr(i, 1) & "|" & Arr(i, 2)
xD(T) = Array(Arr(i, 3), Arr(i, 4))
Next
Arr = Range([d1], [a65536].End(3))
For i = 2 To UBound(Arr)
T = Arr(i, 1) & "|" & Arr(i, 3)
If xD.Exists(T) Then
a = Split(xD(T)(0), ".")
For j = 0 To UBound(a)
If Arr(i, 2) = a(j) Then pos = 1
Next
If pos = 0 Then
Arr(i, 4) = "錯誤，因為" & Arr(i, 1) & "+" & Arr(i, 3) & "，儲位" & xD(T)(1)
Else
Arr(i, 4) = "正確，因為" & Arr(i, 1) & "+" & Arr(i, 3) & "，儲位" & xD(T)(1)
pos = 0
End If
End If
Next
Range("a1").Resize(UBound(Arr), 4) = Arr
End Sub

=IF(ISERR(FIND("."&B2&".",LOOKUP(,0/(A2&C2=G\$6:G\$16&H\$6:H\$16),"."&I\$6:I\$16&"."))),"錯誤","正確")

 歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)