VBA复制到新表A列有空行的怎么自动删除空行,高手请进! 10
Sub总汇()Dimarr,brr,m&,k&,j&arr=[a2].CurrentRegionReDimbrr(1ToUBound(arr),1To24)Fori=4T...
Sub 总汇()
Dim arr, brr, m&, k&, j&
arr = [a2].CurrentRegion
ReDim brr(1 To UBound(arr), 1 To 24)
For i = 4 To UBound(arr)
k = k + 1
For m = 1 To 10
brr(k, m) = arr(i, m)
Next
brr(k, 3) = arr(i, 7): brr(k, 4) = arr(i, 8)
brr(k, 5) = arr(i, 16): brr(k, 6) = arr(i, 17)
brr(k, 7) = arr(i, 18): brr(k, 8) = arr(i, 19)
brr(k, 9) = arr(i, 20): brr(k, 10) = arr(i, 24)
For j = 10 To UBound(arr, 2) - 1
Next
Next
With Sheet6
.[a8:J100000].ClearContents
.[a8].Resize(k, 10) = brr
End With
End Sub
请问这个代码在数据复制到新表格后,A列有空行的如何添加代码进行删除空行呢? 展开
Dim arr, brr, m&, k&, j&
arr = [a2].CurrentRegion
ReDim brr(1 To UBound(arr), 1 To 24)
For i = 4 To UBound(arr)
k = k + 1
For m = 1 To 10
brr(k, m) = arr(i, m)
Next
brr(k, 3) = arr(i, 7): brr(k, 4) = arr(i, 8)
brr(k, 5) = arr(i, 16): brr(k, 6) = arr(i, 17)
brr(k, 7) = arr(i, 18): brr(k, 8) = arr(i, 19)
brr(k, 9) = arr(i, 20): brr(k, 10) = arr(i, 24)
For j = 10 To UBound(arr, 2) - 1
Next
Next
With Sheet6
.[a8:J100000].ClearContents
.[a8].Resize(k, 10) = brr
End With
End Sub
请问这个代码在数据复制到新表格后,A列有空行的如何添加代码进行删除空行呢? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询