View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default Excel2003 Macro runs slow???

You do not need to turn off calculation manually - this code will turn it on
and off, so wrap your code in this

Application.Calculation = xlManual
' your code
Application.Calculation = xlAutomatic

You might find that turning off screen updating might improve things e.g.

Application.ScreenUpdating = False
' your code
Application.ScreenUpdating = True

One other option would be to use Autofilters that hides rows given specific
conditions, thereby avoiding any code at all?


--
Cheers
Nigel



"Infinity" wrote in
message ...

I am using Excel2001 but my colleague is using Excel2003 (her computer
is much faster then mine). When running a macro to hide certain rows in
one thousand rows it runs slow. Let me explain further.

I have one thousand rows. In each cells in this rows will give me a
value of either "x" or "0". This value is an if statement which depends
or 2 other cells in the same row. If the value of this "0" then my macro
would hide these rows.

Running this macro on Excel 2001 is very very fast but when running on
Excel 2003 it is SLOW. I have found out why, is it because Excel 2003
is recalculating each cell when the macro is running . When i
turn the Automatic Calculate to Manual it runs as per normal :( . Why
is this and how do I overcome this problem without having to change the
Automatic Calculation to manual?

Thanks in advance.


--
Infinity
------------------------------------------------------------------------
Infinity's Profile:
http://www.excelforum.com/member.php...o&userid=32725
View this thread: http://www.excelforum.com/showthread...hreadid=530789