{"id":8142,"date":"2021-11-26T12:18:10","date_gmt":"2021-11-26T12:18:10","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=8142"},"modified":"2021-11-26T12:19:50","modified_gmt":"2021-11-26T12:19:50","slug":"use-vba-to-stop-formulas-from-being-deleted","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/office\/use-vba-to-stop-formulas-from-being-deleted\/20928.html","title":{"rendered":"Use VBA To Stop Formulas From Being Deleted"},"content":{"rendered":"<p>BRENDAN June 24, 2017 at 19:04:45<br \/>\nI have this macro to clear data from cells so the sheet can be reused these are all unprotected with no formulas in them Worksheets(&#8220;good one protected&#8221;).Unprotect Password:=<br \/>\nRange(&#8220;C5:O11&#8221;).Select<br \/>\nSelection.ClearContents<br \/>\nRange(&#8220;F16:H20&#8221;).Select<br \/>\nSelection.ClearContents<br \/>\nRange(&#8220;K18:L20&#8221;).Select<br \/>\nSelection.ClearContents<br \/>\nRange(&#8220;N18:N22&#8221;).Select<br \/>\nSelection.ClearContents<br \/>\nRange(&#8220;P18:Q22&#8221;).Select<br \/>\nSelection.ClearContents<br \/>\nRange(&#8220;K22:L22&#8221;).Select<br \/>\nSelection.ClearContents<br \/>\nRange(&#8220;c1&#8221;).Select<br \/>\nSelection.ClearContents<br \/>\nbut i have 3 ranges k18 to k22 n18 to n22 p18 top22<br \/>\nthat have formulas in them can you tell me how to delete the data but keep the formulas<br \/>\nusing via in this formula<br \/>\nany help would be great thanks Brendan<\/p>\n<p>Mac air Excel 16<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":5},"question-category":[53],"question_tags":[],"class_list":["post-8142","question","type-question","status-publish","hentry","question-category-office"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/8142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=8142"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=8142"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=8142"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=8142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}