View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Loops for deleting rows

Dani,

Try something like the following:

Dim LastRow As Long
Dim RowNdx As Long
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp)
If LastRow Mod 2 = 0 Then
LastRow = LastRow + 1
End If
For RowNdx = LastRow To 1 Step -2
Rows(RowNdx).Delete
Next RowNdx
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"daniB " wrote in message
...
I need to go through a spreadsheet and delete all odd

rows.....I have
sooooo many rows that it takes forever and crashes....I need

some VBA
which doesnt crash my spreadsheet!!!

Any ideas??

Thanks Dani


---
Message posted from http://www.ExcelForum.com/