{"id":3216,"date":"2021-04-14T11:11:17","date_gmt":"2021-04-14T18:11:17","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=3216"},"modified":"2021-04-14T11:11:18","modified_gmt":"2021-04-14T18:11:18","slug":"excel-vba-how-to-turn-automatic-calculations-off-or-on","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=3216","title":{"rendered":"Excel VBA \u2013 How to Turn Automatic Calculations Off (or On)"},"content":{"rendered":"\n<p>Whenever you update a cell, Excel goes through a process to recalculate the workbook. When working directly within Excel you want this to happen 99.9% of the time (the exception being if you are working with an extremely large workbook). However, this can really slow down your VBA code. It\u2019s a good practice to set your calculations to manual at the beginning of macros and restore calculations at the end of macros. If you need to recalculate the workbook you can manually tell Excel to calculate.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Turn Off Automatic Calculations<\/h3>\n\n\n\n<p>You can turn off automatic calculation with a macro by setting it to xlmanual. Use the following piece of VBA code:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>Application.Calculation = xlManual<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Turn Automatic Calculations Back On<\/h3>\n\n\n\n<p>To turn back on automatic calculation with the setting xlAutomatic:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>Application.Calculation = xlAutomatic<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>I recommend disabling Automatic calculations at the very beginning of your procedure and re-enabling Automatic Calculations at the end. It will look like this:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whenever you update a cell, Excel goes through a process to recalculate the workbook. When working directly within Excel you want this to happen 99.9% of the time (the exception being if you are working with an extremely large workbook). However, this can really slow down your VBA code. It\u2019s a good practice to set <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=3216\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,18],"tags":[674,675],"class_list":["post-3216","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-microsoft-office","tag-turn-automatic-calculations-off","tag-turn-automatic-calculations-on"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3216"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3216\/revisions"}],"predecessor-version":[{"id":3217,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3216\/revisions\/3217"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}