Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

turn on/off automatic calculation in only a few columns in Excel

In excel I have a worksheet with over 30,000 rows. Sample data is shown in the image below. About a dozen of the columns have formulas which really slow down the work whenever I update a cell. I would like to use VBA code to turn off automatic formula calculation for only 5 columns (see columns in red in example). The formulas in the columns in yellow would run all the time. I would then like to create a macro that calculates the formula in the red columns whenever pressed.

I tried looking for some options in the formula ribbon but wasn't successful.

enter image description here

like image 842
Danny Avatar asked Apr 10 '18 01:04

Danny


1 Answers

If you are creating a macro

Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculateManual

[YOUR CODE HERE]

Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True

But if you just want to enable and disable.. Go to the menu (from the ribbon) Formulas / Calculation Options and select Automatic or Manual as desired.

like image 119
Ricardo González Avatar answered Nov 04 '22 20:11

Ricardo González