
Originally Posted by
KingTamo
Mr. Rick
I tried this modification and it takes the same period nearby
Code:
Sub InsertEmptyRowKingTamo()
Dim LR As Long, I As Long, X As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
X = Int(LR / 4) + LR
For I = 5 To X Step 5
Rows(I).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Next I
End Sub
While your code still takes the same long period ..
That is because the modification I did in Message #5 over-compensated for what was actually needed. This should come in at the same timing as your code...
Code:
Sub Test()
Dim R As Long
For R = 5 To 1.25 * Cells(Rows.Count, "A").End(xlUp).Row Step 5
Rows(R).Insert
Next
End Sub
And this should be somewhat faster (you can do the same for your code to speed it up as well)...
Code:
Sub Test()
Dim R As Long
Application.ScreenUpdating = False
For R = 5 To 1.25 * Cells(Rows.Count, "A").End(xlUp).Row Step 5
Rows(R).Insert
Next
Application.ScreenUpdating = True
End Sub
Bookmarks