# Excel VBA: Turn Off Auto Calculate

In this article, Iâ€™ll show you how you can turn off auto calculate using VBA in Excel.

Excel VBA: Turn Off Auto Calculate (Quick View)

``````Sub Turn_Off_Automatic_Calculation()
Application.Calculation = xlManual
End Sub``````

Read More: How to Make an Excel Spreadsheet to Automatically Calculate Percentage

## An Overview to Turn Off Auto Calculation Using VBA in Excel (Step-by-Step Analysis)

Turning off auto-calculation using Excel VBA is easy. To accomplish this, we need only one line of code. Itâ€™s a better approach to turn off auto-calculation at the beginning of your code and then write the code.

For a better understanding, I am showing you the step-by-step analysis to accomplish this.

â§ª Step 1: Turning Off Auto-Calculation

We said earlier that itâ€™s normally a better approach to turn off auto calculation at the beginning of your code.

``Application.Calculation = xlManual``

â§ª Step 2: Writing the Main Code

Next, write your main code. Here Iâ€™ve written a code to insert a series of 1 to 10 in the first column of the active worksheet.

``````For i = 1 To 10
Â Â Â  Cells(i, 1) = i
Next i``````

Therefore, the complete VBA code will be:

â§­ VBA Code:

``````Sub Turn_Off_Automatic_Calculation()

Application.Calculation = xlManual

For i = 1 To 10
Â Â Â  Cells(i, 1) = i
Next i

End Sub``````

## Developing the Macro to Turn Off Auto Calculation Using Excel VBA

Weâ€™ve seen the step-by-step analysis to turn off to auto calculate using Excel VBA.

Now letâ€™s see how to develop a Macro to run the code.

â§ª Step 1: Opening the VBA Window

Press ALT + F11 on your keyboard to open the Visual Basic window.

Read More: How to Make Excel Auto Calculate Formulas (4 Simple Methods)

â§ª Step 2: Inserting a New Module

Go to Insert > Module in the toolbar. Click on Module. A new module called Module1 (or anything else depending on your past history) will open.

â§ª Step 3: Putting the VBA Code

This is the most important step. Insert the given VBA code in the module.

â§ª Step 4: Checking the Output

Weâ€™ll check the output twice. First, weâ€™ll check the output of the code without turning off the auto calculation.

Here in the active worksheet, in cell A11, we have a formula:

`=SUM(A1:A10)`

It contains the sum of the cells from A1 to A10. When there is no value in the cells, it shows 0.

Now, weâ€™ll eliminate the line Application.Calculation = xlManual from our code, and then run the code from the Run Sub / UserForm option in the Visual Basic toolbar.

A series of 1 to 10 will be entered in the range A1:A10. And cell A11 will automatically show 55, their sum.

Then weâ€™ll clear the contents from cells A1 to A10. The sum in cell A11 will go back to 0 automatically.

Now, weâ€™ll insert the line Application.Calculation = xlManual at the beginning of our code, and then again run the code.

A series of 1 to 10 will be entered in the range A1:A10, but cell A11 will not show 55, itâ€™ll keep the previous value of 0.

This is because we turned off auto-calculation before the execution of the code.

Read More: How to Turn Off AutoSum in Excel (2 Easy Ways)

## Things to Remember

Itâ€™s a better approach to turn off auto-calculation at the beginning of the code, then write your main code, and then finally turn on auto-calculation again. Therefore, after writing the code, insert the line Application.Calculation = xlAutomatic before ending the code.

## Conclusion

Therefore, this is the process to turn off auto-calculation using VBA in Excel. Do you have any questions? Feel free to ask us. And donâ€™t forget to visit our site ExcelDemy for more posts and updates.

## Related Articles

#### Rifat Hassan

Hello! Welcome to my profile. Here I will be posting articles related to Microsoft Excel. I am a passionate Electrical Engineer holding a Bachelorâ€™s degree in Electrical and Electronic Engineering from the Bangladesh University of Engineering and Technology. Besides academic studies, I always love to keep pace with the revolution in technology that the world is rushing towards day by day. I am diligent, career-oriented, and ready to cherish knowledge throughout my life.

We will be happy to hear your thoughts

5 Excel Hacks You Never Knew