Deleting multiple rows (2 rows and leave 1)

Closed
dreamer_886 - Oct 20, 2011 at 04:18 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Oct 20, 2011 at 10:23 PM
Hello,

I need a REALLY QUICK reply. I'm working on a worksheet in excel that has hundreds of rows and I want to delete every 2 consecutive rows and leave the 3rd one. That is I want to delete rows 2&3, 5&6 etc. How can I do that? Thnx

Related:

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Oct 20, 2011 at 10:23 PM
try this macro

Sub test()
Dim j As Long, k As Long
j = Range("A1").End(xlDown).Row
For k = j To 1 Step -1
If k Mod 3 <> 1 Then Cells(k, 1).EntireRow.Delete
Next k
End Sub
0