A
Anthony
Hi
Can someone please advise the main difference between
CalculateFullRebuild and CalculateFull, and when they should (or
should not) be used.
I have a large workbook, and have set the OnKey event for the F9 key
to run my own 'FullCalc' VBA procedure (see below).
I basically try and recalculate the workbook firstly, and then check
the Calculation State.
- If it is still 'Pending' (i.e 'Calculate' appears in the Status
Bar), then i do a Full Calc.
- If the Calculation State is still 'Pending' after a 'Full Calc', if
in Excel 2003, i do a Full Calc with Rebuild.
However, a Full Calc with Rebuild can take over a 1min.
Is it necessary to do a CalculateFullRebuild all the time the user
clicks F9 when the formula dependency limit is reached, or is my
procedure overkill and can i get away with just doing CalculateFull?
------------------------------------------------------------------------------------------------------------------
Private Sub FullCalc()
If Left(Application.Version, 1) = "8" Then '97
SendKeys "%^{F9}", True
Application.SendKeys "%^{F9}"
DoEvents
Else
If Left(Application.Version, 1) = "9" Then '2K
Application.CalculateFull
Else
If Left(Application.Version, 2) >= "10" Then 'XP or later
Calculate
If Application.CalculationState = 2 Then
Application.CalculateFull
If Application.CalculationState = 2 Then
Application.CalculateFullRebuild
End If
End If
End If
End If
End If
Application.Calculation = xlCalculationAutomatic
End Sub
Can someone please advise the main difference between
CalculateFullRebuild and CalculateFull, and when they should (or
should not) be used.
I have a large workbook, and have set the OnKey event for the F9 key
to run my own 'FullCalc' VBA procedure (see below).
I basically try and recalculate the workbook firstly, and then check
the Calculation State.
- If it is still 'Pending' (i.e 'Calculate' appears in the Status
Bar), then i do a Full Calc.
- If the Calculation State is still 'Pending' after a 'Full Calc', if
in Excel 2003, i do a Full Calc with Rebuild.
However, a Full Calc with Rebuild can take over a 1min.
Is it necessary to do a CalculateFullRebuild all the time the user
clicks F9 when the formula dependency limit is reached, or is my
procedure overkill and can i get away with just doing CalculateFull?
------------------------------------------------------------------------------------------------------------------
Private Sub FullCalc()
If Left(Application.Version, 1) = "8" Then '97
SendKeys "%^{F9}", True
Application.SendKeys "%^{F9}"
DoEvents
Else
If Left(Application.Version, 1) = "9" Then '2K
Application.CalculateFull
Else
If Left(Application.Version, 2) >= "10" Then 'XP or later
Calculate
If Application.CalculationState = 2 Then
Application.CalculateFull
If Application.CalculationState = 2 Then
Application.CalculateFullRebuild
End If
End If
End If
End If
End If
Application.Calculation = xlCalculationAutomatic
End Sub