Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Difference btween Automatic and Manual calculations.

I have a macro that is running and it is running slow since it has to wait
for the spreadsheet to do updates. I switch the calculations and it runs
faster. I am wondering if there is loss of anything. What is the difference
between the two and how does that affect calculations. Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Difference btween Automatic and Manual calculations.

When you make a change to a spreadsheet, Excel automatically determines
(based on the change that you made) which cells need to be re-calculated and
marks these cells as dirty. In automatic mode the calculation is done
immediately and the dirty flags are removed. In Manual mode the flags are
just saved up until you manually run a calculation. If you are running code
with calculation turned off and you are grabbing the values of dirty cells,
then you are grabbing the wrong amounts. You just need to be sure that if
your code makes a change that dirties a cell that you do not use the value of
that cell until a re-calc is done.

One more thing... When you toggle the cacluation setting in code it is a
good idea to use an error handler to reset the calculation in the event of a
crash.
--
HTH...

Jim Thomlinson


"WannaBeExceller" wrote:

I have a macro that is running and it is running slow since it has to wait
for the spreadsheet to do updates. I switch the calculations and it runs
faster. I am wondering if there is loss of anything. What is the difference
between the two and how does that affect calculations. Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Difference btween Automatic and Manual calculations.

Thank you Jim for you response. I was just wondering how the error handler
would be implemented. I am using a line that does the recalc
"worksheet(1).calculate". Thanks in advance.

"Jim Thomlinson" wrote:

When you make a change to a spreadsheet, Excel automatically determines
(based on the change that you made) which cells need to be re-calculated and
marks these cells as dirty. In automatic mode the calculation is done
immediately and the dirty flags are removed. In Manual mode the flags are
just saved up until you manually run a calculation. If you are running code
with calculation turned off and you are grabbing the values of dirty cells,
then you are grabbing the wrong amounts. You just need to be sure that if
your code makes a change that dirties a cell that you do not use the value of
that cell until a re-calc is done.

One more thing... When you toggle the cacluation setting in code it is a
good idea to use an error handler to reset the calculation in the event of a
crash.
--
HTH...

Jim Thomlinson


"WannaBeExceller" wrote:

I have a macro that is running and it is running slow since it has to wait
for the spreadsheet to do updates. I switch the calculations and it runs
faster. I am wondering if there is loss of anything. What is the difference
between the two and how does that affect calculations. Thanks in advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Difference btween Automatic and Manual calculations.

sub Test
on error goto ErrorHandler
with application
.calculation = xlManual
'.screenupdating = false
'.displayelerts = false
end with

'Your Code here

'No exit sub so the error handler will procedd into this section even
without an error
ErrorHandler:
with application
.calculation = xlAutomatic
'.screenupdating = true
'.displayelerts = true
end with
End Sub

--
HTH...

Jim Thomlinson


"WannaBeExceller" wrote:

Thank you Jim for you response. I was just wondering how the error handler
would be implemented. I am using a line that does the recalc
"worksheet(1).calculate". Thanks in advance.

"Jim Thomlinson" wrote:

When you make a change to a spreadsheet, Excel automatically determines
(based on the change that you made) which cells need to be re-calculated and
marks these cells as dirty. In automatic mode the calculation is done
immediately and the dirty flags are removed. In Manual mode the flags are
just saved up until you manually run a calculation. If you are running code
with calculation turned off and you are grabbing the values of dirty cells,
then you are grabbing the wrong amounts. You just need to be sure that if
your code makes a change that dirties a cell that you do not use the value of
that cell until a re-calc is done.

One more thing... When you toggle the cacluation setting in code it is a
good idea to use an error handler to reset the calculation in the event of a
crash.
--
HTH...

Jim Thomlinson


"WannaBeExceller" wrote:

I have a macro that is running and it is running slow since it has to wait
for the spreadsheet to do updates. I switch the calculations and it runs
faster. I am wondering if there is loss of anything. What is the difference
between the two and how does that affect calculations. Thanks in advance.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesn't Excel understand what 'Manual' for Calculations? msnyc07 Excel Discussion (Misc queries) 4 February 4th 10 10:24 PM
how can i get MANUAL CALCULATIONS p e r m a n e n t l y Chicago man Setting up and Configuration of Excel 1 August 29th 06 03:56 AM
Automatic and manual calculations Muttley Excel Discussion (Misc queries) 0 March 20th 06 03:06 PM
Automatic and manual calculations bpeltzer Excel Discussion (Misc queries) 0 March 20th 06 02:49 PM
Excel Calculations Open in Manual Occasionally rich32822 Excel Discussion (Misc queries) 1 February 17th 05 09:25 PM


All times are GMT +1. The time now is 02:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"