View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Wilson John Wilson is offline
external usenet poster
 
Posts: 550
Default Detecting Calculation State

Chris,

The following code is from Myrna Larson:

Application.ScreenUpdating = False
SaveCalcMode = Application.Calculation
Application.Calculation = xlCalculationManual
' your code here
Application.Calculation = SaveCalcMode
Application.ScreenUpdating = True

When you get to the "your code here" line, calculation will
be set to manual, regardless of what it was before.
Within your code, you can calculate the entire workbook
Application.Calculation = xlCalculationAutomatic
or a specific sheet
Worksheets("Sheet1").Calculate
With the coding above, Excel will return to whatever calculation
state it was in before you ran the code.

John

Chris Gorham wrote:

firstly, thanks for the invisible range names advice -
thats solved.
is it possible to detect the calculation state of a
workbook such that the macro will only make it recalculate
if it requires it. I run Excel 2000. Thanks