Saturday, January 30, 2010

Macro to delete alternative rows

Sub DeleteEvenRows()
Application.ScreenUpdating = False
Dim i As Long
For i = Cells.SpecialCells(xlLastCell).Row To 2 Step -1
If i Mod 2 = 0 Then Rows(i).Delete
Next i
Application.ScreenUpdating = True
End Sub

No comments:

Post a Comment