ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Recalculation taking a massive 11 seconds (https://www.excelbanter.com/excel-worksheet-functions/55120-recalculation-taking-massive-11-seconds.html)

David.Allen297

Recalculation taking a massive 11 seconds
 
1 Attachment(s)
Hi,

I've designed a simple spreadsheet that's looking at a small table of data and returning 2 values.

(The sheet gets updated by external means, hence I'm using the worksheet_calculate event).

The average of the 2 is then calculated and used to display historical Min and Max values (in the Yellow boxes).

These 3 (Average, Min Average, Max Average) are then rounded to predefined increments.

When I choose selection "A" or "D" and run my code (from a cmdButton) it takes a MASSIVE 11 seconds on my well specced PC..

But if I choose "B", "C", or "E" and run my code it takes less than 1 second.

It's maybe best that you look at the attached example 'dave.xls' and ask if there's anything that you don't understand because I'm useless at explaining things!

Can someone please help me clean up my code, or work out what is wrong?

Thanks,

Dave

Don Guillett

Recalculation taking a massive 11 seconds
 
Please don't post in more than ONE group.

--
Don Guillett
SalesAid Software

"David.Allen297" wrote in
message ...

Hi,

I've designed a simple spreadsheet that's looking at a small table of
data and returning 2 values.

(The sheet gets updated by external means, hence I'm using the
worksheet_calculate event).

The average of the 2 is then calculated and used to display historical
Min and Max values (in the Yellow boxes).

These 3 (Average, Min Average, Max Average) are then rounded to
predefined increments.

When I choose selection "A" or "D" and run my code (from a cmdButton)
it takes a MASSIVE 11 seconds on my well specced PC..

But if I choose "B", "C", or "E" and run my code it takes less than 1
second.

It's maybe best that you look at the attached example 'dave.xls' and
ask if there's anything that you don't understand because I'm useless
at explaining things!

Can someone please help me clean up my code, or work out what is
wrong?

Thanks,

Dave


+-------------------------------------------------------------------+
|Filename: dave.zip |
|Download: http://www.excelbanter.com/attachment.php?attachmentid=45|
+-------------------------------------------------------------------+

--
David.Allen297




David.Allen297

Apologies, it won't happen again.


All times are GMT +1. The time now is 10:18 AM.

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