FormulaR1C1, cell not referring to itself error

gtd526

Well-known Member
Joined
Jul 30, 2013
Messages
657
Office Version
  1. 2019
Platform
  1. Windows
Hello,
The following code works, but when I Offset from another cell to the correct cell and enter the formula, I receive an error (row 48 only being entered). Thank you.
Here is the formula:
Wagers.xlsm
A
47With Range("H" & Rows.Count).End(xlUp)
48 .FormulaR1C1 = "=IFERROR(LOOKUP(2, 1/((COUNTIF(R" & .Row - 1 & "C8:R[-1]C8,'[NFL.xlsm]Weekly Picks'!R4C8:R35C8)=0)*('[NFL.xlsm]Weekly Picks'!R4C8:R35C8<>"""")),'[NFL.xlsm]Weekly Picks'!R4C8:R35C8),"""")"
49End With
NFL to R1C1
 
Try
VBA Code:
ActiveCell.FormulaR1C1 = "=IFNA(LOOKUP(2, 1/((COUNTIF(R[-1]C8,'[NFL.xlsm]Weekly Picks'!R4C8:R35C8)=0)*('[NFL.xlsm]Weekly Picks'!R4C8:R35C8<>"""")*('[NFL.xlsm]Weekly Picks'!r4c6:r35c6="" * "")),'[NFL.xlsm]Weekly Picks'!R4C8:R35C8),0)"
Thank you.
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,694
Members
449,117
Latest member
Aaagu

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