Application-defined or object-defined error

gtd526

Well-known Member
Joined
Jul 30, 2013
Messages
657
Office Version
  1. 2019
Platform
  1. Windows
Hello,
I receive an error when trying to enter a R1C1 formula to a selected cell. Here is the formula-
ActiveCell.FormulaR1C1 = "=IFNA(INDEX('[NFL.xlsm]Weekly Picks'!R4C5:R35C5,MATCH($RC8,'[NFL.xlsm]Weekly Picks'!R4C1:R35C1,FALSE)),0)"
Here is the code:
VBA Code:
Sub Test10()
'insert formula for Parlay W/L
'use IFNA

'offset to correct cell to insert formula
    LastRow = Cells(Rows.Count, "B").End(xlUp).Row      'last row according to "B"
    Range("E" & LastRow).Select  'have to SELECT lastRow to select correct range regarding line below
    Selection.Offset(2, 2).Select
'    Range(Selection, Selection.End(xlDown)).Select 'select ALL moving Down
'insert formula
    ActiveCell.FormulaR1C1 = "=IFNA(INDEX('[NFL.xlsm]Weekly Picks'!R4C5:R35C5,MATCH($RC8,'[NFL.xlsm]Weekly Picks'!R4C1:R35C1,FALSE)),0)"

End Sub

thank you
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
You need to remove the $ sign from $RC8
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,936
Messages
6,122,340
Members
449,079
Latest member
rocketslinger

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