|
- Sub byDD()
- Dim arr, brr(), i%, j%, n%, endRow%
- Application.ScreenUpdating = False
- With Sheets("业务员毛利表")
- arr = .[a1].CurrentRegion
- n = UBound(arr, 2)
- For i = 2 To UBound(arr)
- If arr(i, 5) = 0 Then
- endRow = endRow + 1
- ReDim Preserve brr(1 To n, 1 To endRow)
- For j = 1 To n
- brr(j, endRow) = arr(i, j)
- Next
- End If
- Next
- .[a2].Resize(UBound(arr) - 1, UBound(arr, 2)).ClearContents
- .[a2].Resize(UBound(brr, 2), UBound(brr)) = Application.Transpose(brr)
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码 |
|