|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 天地一相 于 2023-6-29 10:21 编辑
感谢帮助。请用数组办法修改原代码,功能操作不变。原代码:- For c = 1 To Application.WorksheetFunction.CountA(Sheet4.Rows("1:1")) - 2
- Sheet3.Range("C1:C520").Value = Sheet4.Range(Sheet4.Cells(1, c), Sheet4.Cells(520, c)).Value
- For d = c + 1 To Application.WorksheetFunction.CountA(Sheet4.Rows("1:1")) - 1
- Sheet3.Range("D1:D520").Value = Sheet4.Range(Sheet4.Cells(1, d), Sheet4.Cells(520, d)).Value
- For e = d + 1 To Application.WorksheetFunction.CountA(Sheet4.Rows("1:1"))
- Sheet3.Range("E1:E520").Value = Sheet4.Range(Sheet4.Cells(1, e), Sheet4.Cells(520, e)).Value
- Next e, d, c
复制代码
|
|