Reputation: 35
I am using following code and it is taking forever to complete-
For i = 1 To 21408
Range("abcd").Copy
Rows(Range("abcd").Offset(i, 0).Row).Insert Shift:=xlDown
Application.CutCopyMode = False
Next i
abcd is Named Range having 8 fields.
Can someone please suggest a way to optimize this code or re-write in a way to achieve the same output?
Thanks
Upvotes: 1
Views: 109
Reputation: 27478
This does the same thing, much faster:
With Range("abcd")
.Copy
.Offset(1).Resize(21408, .Columns.Count).Insert Shift:=xlDown
Application.CutCopyMode = False
End With
Upvotes: 3