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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
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,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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