|
代码如下。。。
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$BF$1" Then Exit Sub
Application.ScreenUpdating = False
arr = [bf182:bf821]
brr = [bi1:bm1]
ReDim crr(1 To UBound(arr), 1 To UBound(brr, 2))
ReDim drr(1 To UBound(brr, 2))
For i = 1 To UBound(brr, 2)
n = 0
For j = UBound(arr) - brr(1, i) + 1 To 1 Step -brr(1, i)
n = n + 1
crr(n, i) = arr(j, 1)
Next
drr(i) = n
x = Application.Max(x, n)
Next
ReDim frr(1 To x, 1 To UBound(brr, 2))
For Each m In drr
n = 0: k = k + 1
For i = x To 1 Step -1
n = n + 1
frr(n, k) = crr(i, k)
Next
Next
Cells(2, "bi").Resize(641, UBound(brr, 2)).ClearContents
Cells(642 - x + 1, "bi").Resize(x, UBound(frr, 2)) = frr
Beep
Application.ScreenUpdating = True
End Sub
|
评分
-
1
查看全部评分
-
|