+ Reply to Thread
Results 1 to 2 of 2

Excel2003 Macro runs slow???

  1. #1
    Registered User
    Join Date
    03-23-2006
    Location
    Malaysia
    Posts
    47

    Question 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.

  2. #2
    Nigel
    Guest

    Re: 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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1