|
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column < 3 Or Target.Column > 7 Or Target.Row < 2 Then Exit Sub
Dim arr, i, j, n
arr = [c2].CurrentRegion
If UBound(arr, 1) < 20 Then Exit Sub
For i = UBound(arr, 1) - 19 To UBound(arr, 1)
n = n + 1
For j = 1 To UBound(arr, 2)
arr(n, j) = arr(i, j)
Next j, i
With [m2]
.Resize(Rows.Count - 1, UBound(arr, 2)).ClearContents
.Resize(20, UBound(arr, 2)) = arr
End With
Application.EnableEvents = True
End Sub |
评分
-
1
查看全部评分
-
|