View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default macro running extremely slow

I did suggest something different.

Only time I have seen Steve post here was when he was asking a question.
Twice as I remember and that was several years ago.

The only way I would see that as being painfully slow would be if your named
ranges had extensive numbers of cells in them and/or if your sheet takes a
long time to recalculate and you macro causes recalculation each time it
writes to the sheet. In that latter case, I would put

Application.Calculation = xlManual
' executable code
Application.Calculation = xlAutomatic


However, since it appears you are doing some kind of whatif, it might be
necessary to have automatic calculation turned on to get the proper results.

If it is just because of numerous cells, then perhaps recording the cell
values in an array and then writing them all at once to the sheet would be
faster.



--
Regards,
Tom Ogilvy



"sloth" wrote:

I'm addressing like set rng = Range(Application.Names!DefinedName) per
examples in Steven Roman's book, Writing Excel Macros. Would you
suggest something different?

I turned off screen updating and added incrementing of c inside loop,
but it still runs painfully slow. Any other thoughts?