|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。
- Sub ykcbf() '//2024.6.25
- arr = Sheets("原始数据").UsedRange
- zrr = Sheets("关联数据").UsedRange
- ReDim brr(1 To 10000, 1 To 100)
- For i = 2 To UBound(arr)
- For x = 2 To UBound(zrr)
- m = m + 1
- For j = 1 To UBound(arr, 2)
- brr(m, j) = arr(i, j)
- Next
- brr(m, 9) = zrr(x, 7)
- brr(m, 10) = zrr(x, 8)
- brr(m, 11) = arr(i, 5) * zrr(x, 8)
- Next
- Next
- With Sheets("合并数据")
- .UsedRange.Offset(1) = ""
- .[a2].Resize(m, 11) = brr
- End With
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|