Try this instead:
Code
-------------------
Sub delete_rows()
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For row_index = lastrow To 1 Step -1
If IsEven(row_index) = False Then
Rows(row_index).delete
End If
Next
Application.ScreenUpdating = True
End Sub
-------------------
Then add this code to the module
Code
-------------------
Function IsEven(lngNum As Long) As Boolean
IsEven = Not CBool(lngNum Mod 2) 'test
End Function
-------------------
--
Message posted from
http://www.ExcelForum.com