Sub Click()
Dim A, B, i, j, k, x, s
A = Sheets(1).Range("a1").CurrentRegion
ReDim B(1 To UBound(A), 1 To UBound(A, 2))
x = [k1]
For i = 1 To UBound(A)
If A(i, UBound(A, 2)) = x Then
'>>>>>>>>>>>>>>
For k = i To i + 1
If k <= UBound(A) Then
s = s + 1
For j = 1 To UBound(A, 2)
B(s, j) = A(k, j)
Next j
End If
Next k
'<<<<<<<<<<<<<<
End If
Next i
Sheets(3).Select
Cells.Clear
Range("a1").Resize(s, UBound(A, 2)) = B
Range("a1").Select
End Sub
提数附件2.rar
(143.79 KB, 下载次数: 27)
|