|
楼主 |
发表于 2021-1-17 15:38
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub test2()
- Dim arr, brr, i%, i2%, j%, tit, k
- Sheets.Add.Name = "玻璃汇总"
- tit = Array("门窗代号", "玻璃宽/L", "玻璃高/H", "数量", "玻璃种类")
- ReDim brr(1 To 50000, 1 To 5)
- For j = 0 To UBound(tit)
- brr(1, j + 1) = tit(j)
- Next
- k = k + 1
- For i2 = 7 To Sheets.Count
- With Sheets(i2)
- arr = .Range("o38:r43")
- For i = 1 To UBound(arr)
- If Len(arr(i, 1)) Then
- k = k + 1
- brr(k, 1) = .[b16]
- For j = 1 To UBound(arr, 2)
- brr(k, j + 1) = arr(i, j)
- Next
- End If
- Next
- End With
- Next
- With Sheets("玻璃汇总")
- .Range("a1").Resize(1000, 5).ClearContents
- .Range("a1").Resize(k, UBound(brr, 2)) = brr
- End With
- End Sub
复制代码
我稍微修改了一下,致敬cui26896 |
评分
-
1
查看全部评分
-
|