{"id":8938,"date":"2021-11-30T10:32:49","date_gmt":"2021-11-30T10:32:49","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=8938"},"modified":"2021-11-30T10:33:28","modified_gmt":"2021-11-30T10:33:28","slug":"simple-formula-is-not-working-in-macro","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/office\/simple-formula-is-not-working-in-macro\/17389.html","title":{"rendered":"Simple Formula Is Not Working In Macro"},"content":{"rendered":"<p>Hello,<\/p>\n<p>I have created the macro below. I recorded it so that when I tap the button the macro is attached to it inserts a new row above my designeted cell (IMP_01). One of the cells in the new row also has a formula in it which makes it equal 2 of the other cells in the row multiplied by each other. The problem is the first time I run the macro everything works fine. The second time I run the macro the formula does not work\/appear in the new row. In addition, I am using this macro and other similar ones to add new rows and 3 different sections of the same spreadsheet.<\/p>\n<p>Any help would be awesome, thanks!<\/p>\n<p>Range(&#8220;IMP_01&#8221;).Select<br \/>\nSelection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove<br \/>\nRange(&#8220;E29&#8221;).Select<br \/>\nActiveCell.FormulaR1C1 = &#8220;=RC[-2]*RC[-1]&#8221;<br \/>\nRange(&#8220;IMP_01&#8221;).Select<br \/>\nEnd Sub<\/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-8938","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\/8938","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=8938"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=8938"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=8938"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=8938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}