Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用以下代码,它需要很长时间才能完成-
For i = 1 To 21408 Range("abcd").Copy Rows(Range("abcd").Offset(i, 0).Row).Insert Shift:=xlDown Application.CutCopyMode = False Next i
abcd 是具有 8 个字段的命名范围。
有人可以建议一种优化此代码的方法或以某种方式重新编写以实现相同的输出吗?
谢谢
这做同样的事情,速度更快:
With Range("abcd") .Copy .Offset(1).Resize(21408, .Columns.Count).Insert Shift:=xlDown Application.CutCopyMode = False End With