insert a row with the formulas of the row above it

M15tyw00d

Active Member
Joined
Nov 19, 2010
Messages
264
How can I insert a row and have it also continue the formulas?

I found the following but not sure if this is right or if so how to adapt it.

My formatted table is A1:AQ74 with the following formulas

Excel 2007
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQ
11Oct '12Patient Referral ReferralReferralReferralCase MgrFinancial ClassDiagnosisEvaluateDenied /CodeReasonActivityDischargeDischargeAdmitAdmitPNDPNDD/CPhyMedSNFLRUNITAMERIUnitedBCBSCoventryOtherNoNoNoTransport DelayDr ApprovalOtherTotal Delay Time (W)ithin 48 hrs /Total Hours from
12NameFacilityDate/TimeDayDoctorRNPrimarySecondaryDateVoid ?LevelRecActualDate/TimeDayOT #PT #DelayDelayHoldHead BedBedBari BedPt. Not ReadyPt. Appt.DelayHours:Minutes(N)ot within 48 hrsRef. to Adm.
131Jane DoeVCH-F1/13/13 10:00 AMSundayGrundmeyerJoanMBCCVA1/4/131/16/13 1:00 PMWednesday0:123:303:42W30

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Nov 12

Worksheet Formulas
CellFormula
E13=IF(D13="","",TEXT(D13,"dddd"))
S13=IF(R13="","",TEXT(R13,"dddd"))
AO13=IF(SUBTOTAL(109,T13:AN13)=0,"",(SUBTOTAL(109,T13:AN13)))
AP13=IF(D13="","",IF($F$7<=R13-D13,"W","N"))
AQ13=IF(R13="","",IF(AND(INT(D13)=INT(R13),NOT(ISNA(MATCH(INT(D13),$A$3:$F$3,0)))),0,ABS(IF(INT(D13)=INT(R13),ROUND(24*(R13-D13),2),(24*($B$6-$A$6)*(MAX(NETWORKDAYS(D13+1,R13-1,$A$3:$F$3),0)+INT(24*(((R13-INT(R13))-(D13-INT(D13)))+($B$6-$A$6))/(24*($B$6-$A$6))))+MOD(ROUND(((24*(R13-INT(R13)))-24*$A$6)+(24*$B$6-(24*(D13-INT(D13)))),2),ROUND((24*($B$6-$A$6)),2)))))))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



This is the code I found for inserting a row....

Code:
Sub Add_Row_and_Formula()
Dim insRows As Long
insRows = ActiveCell.Row
Selection.Insert Shift:=xlDown
Range("AB" & insRows - 1).Select
Selection.AutoFill Destination:=Range _
("AB" & insRows - 1, "AB" & insRows), Type:=xlFillValues
Range("AB" & insRows - 1, "AB" & insRows).Select
Range("AB" & insRows).Select
End Sub
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,215,584
Messages
6,125,678
Members
449,248
Latest member
wayneho98

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