Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel2003 Macro runs slow???


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



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
Page Setup Macro runs slow William G Excel Discussion (Misc queries) 3 March 31st 09 07:31 PM
Excel macro in 2007 runs extremely slow Acie Excel Discussion (Misc queries) 3 March 3rd 09 04:22 PM
Office 2000 Excel Macro runs very slow in 2003, why? The_Other_Mike Excel Discussion (Misc queries) 1 May 10th 06 04:36 PM
After printing, macro runs slow??? Infinity[_11_] Excel Programming 2 April 5th 06 03:38 AM
Macro runs slow Sandy Excel Programming 10 September 20th 05 04:26 PM


All times are GMT +1. The time now is 09:12 PM.

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"