ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Speedy code required (https://www.excelbanter.com/excel-programming/415912-re-speedy-code-required.html)

egun

Speedy code required
 
A lot of VBA code in Excel can be sped up tremendously if you don't
continuously use references to worksheets, cells, ranges, etc as you go.
Instead, pull all of your initial simulation data into memory and run your
simulations there using arrays to store results. When you're simulation is
completely done, blast your data back onto your worksheet in one big chunk.

Memory is cheap and plentiful these days, so use as much as you want!

Also, using Application.ScreenUpdating = False will eliminate the overhead
of having the screen redraw every time something changes on the active sheet.

Eric

David

Speedy code required
 
Thanks egun,
Application.ScreenUpdating = False - was included
I wondered about taking everything 'off sheet' with arrays ...
Has anyone out there experienced significant advantage with their code by
doing this? Please let me know

"egun" wrote:

A lot of VBA code in Excel can be sped up tremendously if you don't
continuously use references to worksheets, cells, ranges, etc as you go.
Instead, pull all of your initial simulation data into memory and run your
simulations there using arrays to store results. When you're simulation is
completely done, blast your data back onto your worksheet in one big chunk.

Memory is cheap and plentiful these days, so use as much as you want!

Also, using Application.ScreenUpdating = False will eliminate the overhead
of having the screen redraw every time something changes on the active sheet.

Eric



All times are GMT +1. The time now is 08:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com