Macro for deleting everyother six rows starting with row 7.

[Closed]
Report
-
Posts
2779
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
July 29, 2021
-
Hello,
I am trying to use the macro function to delete six rows, skip six row, then delete six and so on. Can you help me?


1 reply

Posts
2779
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
July 29, 2021
468
Hi Joy,

Here is your macro code:
Sub RunMe()
Dim x, y As Integer

'Delete rows 7:13
x = 7
y = 13

Do
    Rows(x & ":" & y).Delete
    'Skip 1 row
    x = x + 1
    y = y + 1
'Stop deleting rows when 93 (100-7) rows are skipped.
Loop Until x = 100

End Sub


Best regards,
Trowa

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!