Issues with entering formula using for loop error 1004

appz

New Member
Joined
Apr 23, 2012
Messages
10
Hi all,

I am tyring to do a simple(atleast thats what I thought) code.
I have a drop down which calculates the principal payments based on the cashflow period specified in the drop down.
The drop down has 3 items,
Monthly
Quaterly and Yearly

Here is my code
Sub DropDown706_Change()
' Paydown dropdown
Dim lngLast_Row As Long
Dim lngRow As Long


lngLast_Row = Worksheets("Detail").Range("B" & Rows.Count).End(xlUp).Row

'Dropdown selections
Select Case Worksheets("Detail").Range("AmortizationPeriodDropDown")
Case "2" ' Quaterly Cashflow
Worksheets("Detail").Range("B38:B398").Value = "" 'Converts the value to null
For lngRow = 39 To lngLast_Row Step 2
Worksheets("Detail").Activate
Range("b39").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]<(TERM*12),-PPMT(RATE/4,RC[-1],AMORT_PERIOD,AMOUNT),AMOUNT-SUM($B$38:RC))"

Next


End Select
End Sub

I am including only the qtrly option code. This gives me an error 1004 object undefined error in formulaR1c1 code.

Appreciate your help
appz
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

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