# Manual, Semi Automatic and Automatic Calculation or Call Calculation in VBA

## Explanation

## Code

Public Sub Manual_Semi_Automatic_and_Automatic_Calculation_or_Call_Calculation_in_VBA ()

If range(“C5”).value=1 then

Application.Calculation = xlAutomatic

End if

If range(“C5”).value=1 then

Application.Calculation = xlSemiautomatic

End if

If range(“C5”).value=1 then

Application.Calculation = xlManual

End sub

Public Sub Calculate_On_Demand_VBA ()

Calculate

End sub

## Comments

Nowhere in the Explanation text is the term semi-automatic used so it is not immediately clear what it does. It takes a few read throughs to understand what is meant.If an explanation for a simple task such as this is even a little confusing it could make people stop reading and go somewhere else. I almost did this. I like your website format though.

Comment made by: Rod , 2017-10-10 02:21:30

# Write Comment:

A program for setting the calculation options or calling the calculation on demand.

To be able to calculate only on demand can be time saving in some situation when writing figures to the excel sheet if it contains a lot of formulas then it can be good to set the calculation option to manual. On the other hand if combining code with formulas the formulas needs to be updated before data is extracted from the sheet, then it is good to be able to call the calculate on demand. Normally if you only have a small number of formulas then this function is not relevant but for large scale formulas then is very good if you want to speed optimize your program.

The VBA Macro Code is available for downloading at the end of this page!

If range(“C5”).value=1 then

Application.Calculation = xlAutomatic

End if

If range(“C5”).value=1 then

Application.Calculation = xlSemiautomatic

End if

If range(“C5”).value=1 then

Application.Calculation = xlManual

End sub

Public Sub Calculate_On_Demand_VBA ()

Calculate

End sub

Download excel file! Manual_Semi_Automatic_and_Automatic_Calculation_or_Call_Calculation_in_VBA.xls

Comment made by: Rod , 2017-10-10 02:21:30