Type Mismatch

gtd526

Well-known Member
Joined
Jul 30, 2013
Messages
657
Office Version
  1. 2019
Platform
  1. Windows
Hello,
Receiving this error on entering a R1C1 formula:
Here is the code:
VBA Code:
Sub Test10()
'betting Team Non-Parlay
    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(0, 3).Select
'    Range(Selection, Selection.End(xlDown)).Select 'select ALL moving Down
'insert formula
    ActiveCell.FormulaR1C1 = "=LOOKUP(2, 1/((COUNTIF(R[-1]C8:RC8, '[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)"

End Sub
Thank you.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
With all these formula issues you are having, there is a little trick you can use, to let Exceldo all the work for you.
Turn on your Macro Recorder, and record yourself entering the formula manually onto the sheet.
When you get it working correctly, stop the Macro Recorder and view your code.
Find the last line of code that has ".FormulaR1C1 = ..." in it, and copy everything after that on top of the formula that you have.
Then you should have a good working formula, as Excel wants it.
 
Upvote 0
With all these formula issues you are having, there is a little trick you can use, to let Exceldo all the work for you.
Turn on your Macro Recorder, and record yourself entering the formula manually onto the sheet.
When you get it working correctly, stop the Macro Recorder and view your code.
Find the last line of code that has ".FormulaR1C1 = ..." in it, and copy everything after that on top of the formula that you have.
Then you should have a good working formula, as Excel wants it.
Done. Thank you.
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,175
Members
449,071
Latest member
cdnMech

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