|
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
arr = Sheet11.Range("CI1216:FJ1217")
brr = Sheet11.Range("CI3:FJ1218")
ReDim crr(1 To 105, 1 To UBound(brr, 2))
For c = 1 To UBound(brr, 2)
s1 = CStr(arr(1, c))
s2 = CStr(arr(2, c))
m = UBound(crr, 1)
For i = UBound(brr, 1) To 3 Step -1
If CStr(brr(i - 1, c)) = s2 And CStr(brr(i - 2, c)) = s1 Then
crr(m, c) = brr(i, c)
Debug.Print m, i, brr(i, c)
m = m - 1
End If
Next
Next
[D1].Resize(UBound(crr, 1), UBound(crr, 2)) = crr
End If
End Sub
|
评分
-
1
查看全部评分
-
|