|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub lll()
Dim arr()
Dim arr1
Dim i As Integer
Dim k As Integer
Range("m16:n16") = Array("商品型号", "出")
Range("n17:p17") = Array("数量", "单价", "金额")
Range("m16:m17").Merge
Range("n16:p16").Merge
arr1 = Range("a1").CurrentRegion
For i = 4 To UBound(arr1) - 1
If arr1(i, 5) <> "" Or arr1(i, 5) <> 0 Then
k = k + 1
ReDim Preserve arr(1 To 4, 1 To k)
arr(1, k) = arr1(i, 1)
arr(2, k) = arr1(i, 5)
arr(3, k) = arr1(i, 6)
arr(4, k) = arr1(i, 7)
End If
Next
Range("m18:p" & 17 + UBound(arr, 2)) = Application.WorksheetFunction.Transpose(arr)
End Sub
|
评分
-
1
查看全部评分
-
|