It is a little difficult to comment on exactly why the code is running
slowly, but it could definietly be improved upon with VBA. Instead of
performing possibly hundreds of deletes you could create one big range of
specific cells and then delete the entire thing in one operation (which is
distinctly faster). If you want help with that just reply back. As for
memeory and such here is a web site that shows you a bunch of things to speed
up your applications.
http://www.decisionmodels.com/index.htm
--
HTH...
Jim Thomlinson
"AG" wrote:
The code below needs to check about 2,000 rows. It begins to slow
considerable after about 100 rows and its speed gets worse the longer it
runs. The code is run within a workbook with multiple sheets. Ive tried
turning off calculation, no screen updating and hiding sheets not affected by
the macro.
Im running Excel 2002 SP3 on a machine with:
Physical memory of 512 MB
Available memory of 211 MB
Virtual memory of 2 GB
Available Virtual Mem. Of 1.96 GB
Page file size of 1.22 GB
=SELECT("R4C1")
=SELECT.END(4)
=SELECT("R[1]C1")
=FORMULA("End")
=SELECT("R4C1")
=WHILE(ACTIVE.CELL()<"End")
=IF(ACTIVE.CELL()<OFFSET(ACTIVE.CELL(),0,2))
=SELECT("R[0]C3:R[0]C4")
=EDIT.DELETE(2)
=SELECT("R[0]C1")
=ELSE()
=SELECT("R[1]C1")
=END.IF()
=NEXT()
=RETURN()
Whats going on and any ideas on increasing the performance?
Would re-writing the macro with VBA help?