Application.Calculation = xlManual

Tonto111

Board Regular
Joined
Jun 17, 2002
Messages
83
I saw this in another post...what is the advantage/disadvantage to doing this in a macro?

Where would you put it in a macro, and can you just put it into VBA to run when the workbook opens up?

Sorry if these are basic questions..THANKS>
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi,

It is good to set calculations to manual if you have a large spreadsheet with lots of formulas, it keeps the thing from recalculating all those formulas when you change anything, which can get very slow.

You force the calculation with F9

HTH,
Corticus
 
Upvote 0
I would only use it if you have a lot of data to write to a sheet.

If this is the case, in the procedure before the data writing starts set it to manual and afterwards revert it back to auto.

It can be quite a pain if you forget that excel is in manual calc mode :)
 
Upvote 0
Hi Tonto,

Yes, Corticus is right on. I just want to add that when you write a macro that updates a worksheet containing formulas it is a good idea to turn calculation off at the beginning and back on at the end so that worksheet formula updates are not done repeatedly as the macro changes the worksheet, but rather just once at the end.
 
Upvote 0
You can save your workbook with calculation set to manual. If that's the only workbook you ever open and you never change the setting then you don't need any VBA.

But if you open it on top of a workbook with calculation set to automatic it inherits the automatic property, so you need VBA to reset it to manual.

Mostly I use manual calculation. That's the setting in my Book and Sheet templates so new workbooks have it too. Excel tells me if I need to calculate and I rarely forget. On anything other than a small spreadsheet automatic calculation just slows the data entry process down.
 
Upvote 0
Also - (my pennies worth)...

If you have multiple sheets and some parts of the macro depend upon calculated fields on certain sheets then Manual Calculate is still a must BUT remember the useful code that is:

Sheets("Sheet1").calculate

So rather than hitting F9 or having to use Application.Calculate in VB you can calculate individual sheets as your Macro progresses (as and when required).

I find that it's also a very useful macro to have if I am working on a massive spreadsheet - or creating one and you just want to calculate one sheet as opposed to hitting F9.

Anyway...that's my bit over.

Luke
 
Upvote 0

Forum statistics

Threads
1,216,156
Messages
6,129,192
Members
449,492
Latest member
steveg127

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top