VBA Code to copy formula from above row, already have macro to add row

Chris9999

New Member
Joined
Jun 19, 2013
Messages
10
Hi,
My macro inserts a row but I am finding that not all of the formulas are on the new row. The line above and below the inserted line have the formulas in the cells. The data validation cells in the new row work fine with the current macro, it is only my sumif formulas that do not appear to be copied to the new row.

Any Suggestions?

Code:
Sub Insert_Rows()
' Insert_Rows Macro
Application.ScreenUpdating = False
ActiveSheet.Unprotect Password:="XXXX"
ExtraRows = Range("N1")  '****** edit to suit
Rows(39 + ExtraRows).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("N1") = Range("N1") + 1
ActiveSheet.Protect Password:="XXXX"
End Sub

Also, was the VBA code properly entered in thread?

Thank you for your help,
Chris
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Just to clarify. I have 10 columns and my last row to enter data is 38, when run the Insert Rows macro, the row gets added and the first four columns copies the data validation from the previous row into the row 39, this is perfect. Then I have an amount column and two total columns that the formula is not copying to the new row. Any ideas.
Thank you very much for your help. I have been struggling with this some time.
Chris
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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