View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Alex J Alex J is offline
external usenet poster
 
Posts: 85
Default Making code more efficient

Tommi,
A few thoughts:

1. You will see a wide list of topics fro perfromance improvement in the
links provided in other responses . Of these, (after doing the basics like
no selects, etc), personal experience suggests that you should look at
clearing .emf files from you temp folder as a key step.

2. If you are not doing so, consider reading all your lists into VBA as
arrays (using single read technique). Do all the manipulations in VBA, and
then do array writes (single write technique) back to the sheets. While
cell-by-cell reads are slow, cell-by-cell writes or other on-sheet
manipulations are much slower (I think 8-10 times slower (?)).

3. Consider using collections to index your lists - I have found this to be
effective to avoid a large number of array search functions.

Hope this adds to the body of wisdom you will collect from your post.

Alex J


"Tommi" wrote in message
...
Hello!
I have code, which manages lists (so the code will make heavy use of
for-loops, comparisons, sorting, filtering and that kind of stuff = quite
basic, but time-consuming).
Running my code will in some cases take quite a lot of time. In the
beginning of every procedure, I put Application.ScreenUpdating = False (

in
the end of procedure again True). I put also Application.Calculation =
xlCalculationManual in the beginning (and in the end again to Automatic).

Is there any other things, I should take into account, if I want my code

run
more efficiently?

BR, Tommi