Skip to content

Instantly share code, notes, and snippets.

@TerenceLiu98
Created September 24, 2020 06:22
Show Gist options
  • Save TerenceLiu98/d09fd87ecde8e6eac936ba632f72a0f1 to your computer and use it in GitHub Desktop.
Save TerenceLiu98/d09fd87ecde8e6eac936ba632f72a0f1 to your computer and use it in GitHub Desktop.
Sub BatchCopy()
Application.ScreenUpdating = False 'turnoff screen refresh
For i = 5 To 2 Step -1
For n = 1 To 3
Rows(i & ":" & i).Select
Selection.Copy
Selection.Insert Shift:=xlDown
Next n
Next i
Application.ScreenUpdating = True
End Sub
@TerenceLiu98
Copy link
Author

code from ZHIHU

@TerenceLiu98
Copy link
Author

TerenceLiu98 commented Oct 31, 2020

Sub remove_rows()
Dim x As Long
Application.ScreenUpdating = False

For x = 297 To 1 Step -5
    Range(x & ":" & x - 3).EntireRow.Delete
Next x

Application.ScreenUpdating = True
End Sub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment