|
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ar, br, cr(), r&
If Target.Address <> "$BF$1" Then Exit Sub
br = [{"BI579",10;"BJ611",20;"BK627",40;"BL635",80;"BM639",160}]
r = Cells(Rows.Count, "BF").End(xlUp).Row
ar = Range("BF182:BF" & r).Value
[BI579].CurrentRegion.ClearContents
Application.EnableEvents = False
For i = 1 To UBound(br)
Erase cr: r = 0
For j = 1 To UBound(ar) Step br(i, 2)
r = r + 1
ReDim Preserve cr(1 To r)
cr(r) = ar(j, 1)
Next j
Range(br(i, 1)).Resize(UBound(cr)) = Application.Transpose(cr)
Next i
Application.EnableEvents = True
End Sub
|
评分
-
1
查看全部评分
-
|