+ Reply to Thread
Results 1 to 4 of 4

Speed up the vba engine

  1. #1
    Forum Contributor
    Join Date
    03-09-2004
    Posts
    140

    Speed up the vba engine

    Hi there

    Is there any way to speed up the vba engien, either by follwo certain code lines or through loading a specific compiler or getting an external application that helps invresing the vba engin ?
    Yours
    hesham Almakki
    http://www.almakki.com.ly/

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon Helmekki (I've answered one of yours before haven't I...?)

    VBA is an interpreted language as it is compiled at run time - there are no third party compilers and VBA (unlike regular VB) cannot run outside of Excel (or Access or Powerpoint et al).

    However, by clever programming you can speed things up a bit.
    1. Turn off screenupdating using:
    Application.Screenupdating=False
    but don't forget to turn it back on before the routine finishes.
    2. Use Option Explicit at the start of your code - this forces you to declare all variables.
    3. Use the With - End With construct if you are manipulating the same object over several consecutive lines, rather than keep referring to it.
    4. Use the Case function instead of If - Then decisions if possible.
    5. If you are referencing a number of cells that are then recalculating, then consider setting the recalc function to manual and forcing the recalc once the code has finished. The commands below should help you out.
    Calculate
    Application.Calculation = xlManual
    Application.Calculation = xlAutomatic

    HTH

    DominicB

  3. #3
    Forum Contributor
    Join Date
    03-09-2004
    Posts
    140
    Thank u very much, dominicb

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    No problem Hesham. Thank you for the feedback.

+ 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