+ Reply to Thread
Results 1 to 10 of 10

Very Slow Macro... Any Advice How To Speed It Up, Please?

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    US
    MS-Off Ver
    Excel 1997
    Posts
    16

    Question Very Slow Macro... Any Advice How To Speed It Up, Please?

    ..........
    Last edited by mrodrigues; 12-11-2012 at 02:01 AM.

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Very Slow Macro... Any Advice How To Speed It Up, Please?

    Well, the good news is that this code has lots of potential for improving speed.

    Here is some reading for you:
    http://www.ozgrid.com/VBA/SpeedingUpVBACode.htm
    http://blogs.office.com/b/microsoft-...practices.aspx

    I haven't studied your code very carefully so I might be off a bit here. And it's the end of the day...
    I give you some samples here to start with, hopefully someone else will help out as well.

    This:
    Please Login or Register  to view this content.
    could be replaced by this:
    Please Login or Register  to view this content.

    One of the first things is to avoid Select and Activate as much as possible. Yes, the macrorecorder loves that stuff but it really hurts speed.
    Example:
    Please Login or Register  to view this content.
    replace with:
    Please Login or Register  to view this content.

    Yet another basic thing is to declare all your variables. You've done a good job so far but here is a tip.
    In the VBA editor, Tools menu -> Options... -> Editor make sure that the Require Variable Declaration box is checked.
    This will automatically put a Option Explicit on top of every new module and this in turn will give you an error if you forgot to declare a variable. Will help speed a little bit and eliminate some boring faultfinding of variables with the wrong name.
    You should manually type Option Explicit on top of your module since it's already there. This will find the variables you forgot to declare.


    Copy paste in VBA should be avoided in general and copy pasting entire rows or columns is really not a good idea.

    Well that was a start, I'm confident other people here will give you more hands on advise. I see a loop that someone most likely will eliminate...
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Registered User
    Join Date
    10-16-2012
    Location
    US
    MS-Off Ver
    Excel 1997
    Posts
    16

    Re: Very Slow Macro... Any Advice How To Speed It Up, Please?

    ..........
    Last edited by mrodrigues; 12-11-2012 at 02:03 AM.

  4. #4
    Registered User
    Join Date
    10-16-2012
    Location
    US
    MS-Off Ver
    Excel 1997
    Posts
    16

    Re: Very Slow Macro... Any Advice How To Speed It Up, Please?

    ..........
    Last edited by mrodrigues; 12-11-2012 at 02:03 AM.

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Very Slow Macro... Any Advice How To Speed It Up, Please?

    Hi

    You seem to be bringing in all the items from column A whenever you search for an item. Do you really only want to bring in the items when the Component Type is DUT, CAP or RES? If so, then advanced filter will be much faster.

    rylo

  6. #6
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Very Slow Macro... Any Advice How To Speed It Up, Please?

    Hi -

    If you can post a few sample of the results you need then it might help.

    Regards,
    Event

  7. #7
    Registered User
    Join Date
    10-16-2012
    Location
    US
    MS-Off Ver
    Excel 1997
    Posts
    16

    Re: Very Slow Macro... Any Advice How To Speed It Up, Please?

    .............
    Last edited by mrodrigues; 12-11-2012 at 02:02 AM.

  8. #8
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Very Slow Macro... Any Advice How To Speed It Up, Please?

    Hi -

    How about this one?
    Please Login or Register  to view this content.
    Regards,
    Event

  9. #9
    Registered User
    Join Date
    10-16-2012
    Location
    US
    MS-Off Ver
    Excel 1997
    Posts
    16

    Re: Very Slow Macro... Any Advice How To Speed It Up, Please?

    ...........
    Last edited by mrodrigues; 12-11-2012 at 02:02 AM.

  10. #10
    Registered User
    Join Date
    10-16-2012
    Location
    US
    MS-Off Ver
    Excel 1997
    Posts
    16

    Re: Very Slow Macro... Any Advice How To Speed It Up, Please?

    ..........
    Last edited by mrodrigues; 12-11-2012 at 02:01 AM.

+ 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