Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveSheet.UsedRange.EntireRow.Delete
-- Regards, Tom Ogilvy "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/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Missed the "odd" in "all odd rows"
So don't use my suggestion. -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... ActiveSheet.UsedRange.EntireRow.Delete -- Regards, Tom Ogilvy "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/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro for deleting rows and serialising the remaing rows | Links and Linking in Excel | |||
Macro for deleting rows and serialising the remaing rows | Excel Worksheet Functions | |||
Help!! I have problem deleting 2500 rows of filtered rows!!!! | Excel Discussion (Misc queries) | |||
deleting hidden rows so i can print only the rows showing?????? | Excel Worksheet Functions | |||
Loops to delete rows | Excel Programming |