How to speed up VBA?

  • Thread starter Thread starter Cactus
  • Start date Start date
C

Cactus

A Excel file has a lot of VBA code.
I want to making it load with faster.

I think if use VB DLL to place VBA code, it may be faster.
because the DLL without VBA debugger watching.

Thanks your any idea.
 
A DLL will be quicker as it is pre-compiled, but that is a major step to go
that way. There may be many other things you can do before that. A few
ideas, others will offer more,

turn off screenupdating if you have worksheets being changed
turn calculation to manual at the start and reset at the end
make sure that you are not selecting within your code

Then there is the design. Look again at what you are doing and whether there
are simpler ways to achieve it.
 
If a sheet included a range reference function.
when a VBA code modify any sheet.
these functions will updating every time.
is "turn off screenupdating" disable that?
 
No, it just stops the window being re-painted when it is changed. Remember
to reset at the end.
 
Back
Top