|
Sub QQ378638653()
ar = Range("a112:al115")
br = Range("z104:ae107")
ReDim cr(1 To UBound(ar, 2) - UBound(br, 2) + 1, 1 To UBound(br), 1 To UBound(br, 2))
ReDim arr(1 To 1, 1 To UBound(cr))
For i = 1 To UBound(cr)
jh = 0: n = 0
For j = 1 To UBound(br)
For k = i To i + UBound(br, 2) - 1
cr(i, j, k - i + 1) = ar(j, k)
If br(j, k - i + 1) <> "" And cr(i, j, k - i + 1) <> "" Then
n = n + 1
End If
If n > 1 Then
jh = 1
arr(1, i) = 1
Exit For
End If
Next
If jh = 1 Then Exit For
Next
Next
Range("d127").Resize(1, UBound(cr)) = arr
End Sub
先上一段臭的代码,有意会给你全新的算法,效率远超此段代码 |
|