Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VB Slows to Crawl when Deleting Rows

The macro is pretty basic. If the activecell has a value of 0 then the
entire row is deleted if not 0 then offset to the next row down and loop.
The problem seems to be that the spreadsheet has several dozon groupings.
After about 100 rows into the process the looping slows to one row every few
seconds and it just keeps getting slower and sloower and sloowweeerrr.

Any thoughts/suggestions?

Windows XP SP1
512 MB memory
Excel 2002 SP2

Sub DeleteZeroDataIAN()
Application.ScreenUpdating = False
Range("bl10").Activate
Do Until i = 650

If ActiveCell.Value < "" And ActiveCell.Value = 0 Then

ActiveCell.EntireRow.Delete

Else
ActiveCell.Offset(1).Activate


End If

i = i + 1

Loop

Application.ScreenUpdating = True
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default VB Slows to Crawl when Deleting Rows

All those activates will slow things down. Take a look he

http://www.rondebruin.nl/delete.htm#AutoFilter

hth,

Doug

"forbesy" wrote in message
...
The macro is pretty basic. If the activecell has a value of 0 then the
entire row is deleted if not 0 then offset to the next row down and loop.
The problem seems to be that the spreadsheet has several dozon groupings.
After about 100 rows into the process the looping slows to one row every

few
seconds and it just keeps getting slower and sloower and sloowweeerrr.

Any thoughts/suggestions?

Windows XP SP1
512 MB memory
Excel 2002 SP2

Sub DeleteZeroDataIAN()
Application.ScreenUpdating = False
Range("bl10").Activate
Do Until i = 650

If ActiveCell.Value < "" And ActiveCell.Value = 0 Then

ActiveCell.EntireRow.Delete

Else
ActiveCell.Offset(1).Activate


End If

i = i + 1

Loop

Application.ScreenUpdating = True
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VB Slows to Crawl when Deleting Rows

Thanks Doug, that worked perfectly!

"Doug Glancy" wrote:

All those activates will slow things down. Take a look he

http://www.rondebruin.nl/delete.htm#AutoFilter

hth,

Doug

"forbesy" wrote in message
...
The macro is pretty basic. If the activecell has a value of 0 then the
entire row is deleted if not 0 then offset to the next row down and loop.
The problem seems to be that the spreadsheet has several dozon groupings.
After about 100 rows into the process the looping slows to one row every

few
seconds and it just keeps getting slower and sloower and sloowweeerrr.

Any thoughts/suggestions?

Windows XP SP1
512 MB memory
Excel 2002 SP2

Sub DeleteZeroDataIAN()
Application.ScreenUpdating = False
Range("bl10").Activate
Do Until i = 650

If ActiveCell.Value < "" And ActiveCell.Value = 0 Then

ActiveCell.EntireRow.Delete

Else
ActiveCell.Offset(1).Activate


End If

i = i + 1

Loop

Application.ScreenUpdating = True
End Sub





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 chats slow to a crawl KenT Charts and Charting in Excel 0 August 27th 07 03:30 AM
print area selection slows excel, formula for hiding rows?? sbrimley Excel Discussion (Misc queries) 1 March 21st 06 11:26 PM
Excel Slowing To A Crawl Paul W Smith[_3_] Excel Programming 12 November 17th 03 06:55 PM
VBA code slows to a snails crawl when screen saver activated Stephen Bain Excel Programming 2 October 30th 03 06:06 PM


All times are GMT +1. The time now is 01:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"