update of worksheet cell extremely slow

  • Thread starter MÃ¥ns TÃ¥nneryd
  • Start date
M

MÃ¥ns TÃ¥nneryd

Hi!

We have a very simple VBA procedure that generates and writes random numbers
into a worksheet cell. On most of our client computers this runs as fast as
you would expect but on a few of them it takes forever. We have not been able
to figure out why. Anyone out there who knows what could make excel consume
huge amounts of cpu cycles when writing to a worksheet cell?

/MÃ¥ns
 
B

Barb Reinhardt

Have you done the following before execution

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

And at the end

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic

HTH,
Barb Reinhardt
 
C

Chip Pearson

I would add to that list

Application.EnableEvents = False
' your code
Application.EnableEvents = True

It is possible that there is a change event handler somewhere that is
executing every time a cell's value is changed.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top