Consulting

Results 1 to 4 of 4

Thread: How to speed up VBA?

  1. #1

    How to speed up VBA?

    Dear all, I have a very large array in my VBA code and felt that calculation is really slow.

    So is there any trick to speed up calculation in VBA? Should I use C to handle computationally intensive portion of my code?

    Thanks for your input.

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Array calculations are very fast. The slow down is most likely something else. See: http://vbaexpress.com/kb/getarticle.php?kb_id=1035

  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,726
    Location
    I'd suggest that -- since you have the data in an array -- then either

    1. You have a LOT of data

    2. You have loops within loops within loops ....

    3. Your algorithm is not very effecient

    Without seeing the code, the only sure fire solution would be to buy a faster computer

    Paul

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Tyr this site for a few suggestions
    http://www.decisionmodels.com/optspeedb.htm
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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