+ Reply to Thread
Results 1 to 4 of 4

Speed up macro

  1. #1
    Registered User
    Join Date
    07-19-2010
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    14

    Speed up macro

    Looking for help speeding up a macro

    Hi, sorry to ask for help here was just wondering if anybody had some time to help me with an issue I have.

    I use Excel 2007 and Windows 7, and I have this series of macros. The main macro calls different other macros through its general run. It works and everything just fine but I really need to make it faster, as the size of the data that it runs over can be VERY large and can take some time to run. I have read about a number of things that haven’t really helped a lot, like disabling events, screenupating, page breaks, status bar etc. Some of them didn’t help at all, some of them did in certain parts so I /think/ I have those covered.

    The main problem I have with it is all the information varies….the size, columns/rows, can be very large very small, numerous. Anyways if anyone sees any ways to speed it up significantly please let me know! And thanks for any possible help for a first time poster!


    Please Login or Register  to view this content.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Looking for help speeding up a macro

    Tip #1 - remove the STATUS BAR coding, updating and displaying status reports greatly reduces speed.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-19-2010
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Speed up macro

    Thanks JBeaucaire, I really appreciate your response.

    I had read the same thing, and tried it out and it didnt /seem/ to make any difference. Since you mentioned it I went ahead and tested it, first I ran it twice with two matrices and got the times of 34 and 35 seconds.

    Then I took out the :


    Please Login or Register  to view this content.

    And added at the begining and end:

    Please Login or Register  to view this content.
    I got 47 seconds and 47 seconds on the same two matrices.

    Then reverted back to the original and ran it again and got 36 and 35 seconds.

    So I am not sure exactly how it will respond to 100 matrices versus 2, maybe it would make it faster with a bunch more to process but with just a few it seemed to make it take longer which is weird. Let me try it with no Status Bar code at all.

    Edit: With no status bar coding at all (not eveing making it false and true, just nothing) I got 45 and 47 seconds. Then I thought to myself maybe storing x and mycol in the first part but not really doing anything with it made it slow down. So I took out x = x +1 and all the MyCol lines and got 46 and 47 seconds. Went ahead and reverted it back to original code and got 36 and 35 seconds. =(
    Last edited by Jasrenkai; 07-19-2010 at 09:36 PM.

  4. #4
    Registered User
    Join Date
    07-19-2010
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Speed up macro

    Anyone else possibly see anything, or can offer any advice?

+ 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