vba entering a R1C1 formula

gtd526

Well-known Member
Joined
Jul 30, 2013
Messages
657
Office Version
  1. 2019
Platform
  1. Windows
Hello,
I'm trying to enter a formula using R1C1 formula, but Im receiving an error. The Row will adjust to the cell Im entering the formula.
Its referring to another workbook/worksheet.
Here is the formula Im trying to enter:
Selection.FormulaR1C1 = "=IF(RC12="","",SUMIFS([NBA.xlsm]Favs!R7C44,R142C64,[NBA.xlsm]Favs!$R5C40,R140C60,RC12))"

Thank you.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
You need to double up your quotes


VBA Code:
=IF(RC12="""","""",SUMIFS([NBA.xlsm]Favs!R7C44,R142C64,[NBA.xlsm]Favs!$R5C40,R140C60,RC12)
 
Upvote 0
You need to double up your quotes


VBA Code:
=IF(RC12="""","""",SUMIFS([NBA.xlsm]Favs!R7C44,R142C64,[NBA.xlsm]Favs!$R5C40,R140C60,RC12)
I made the correction, but still receive an error:
code im using:
VBA Code:
Range("P100000").End(xlUp).Select
        Range(Selection, Selection.End(xlUp)).Select
'        Selection.FormulaR1C1 = "=IF(RC12="","",SUMIFS([NBA.xlsm]Favs!R7C44,R142C64,[NBA.xlsm]Favs!$R5C40,R140C60,RC12))"
        Selection.FormulaR1C1 = "=IF(RC12="""","""",SUMIFS([NBA.xlsm]Favs!R7C44,R142C64,[NBA.xlsm]Favs!$R5C40,R140C60,RC12)"
I also modified the ")" and the end to "))" but received the same error.
 
Upvote 0
Post your formula that you put in the cell manually.
 
Upvote 0
Try
VBA Code:
        Selection.FormulaR1C1 = "=IF(RC12="""","""",SUMIFS([NBA.xlsm]Favs!R7C44:R142C64,[NBA.xlsm]Favs!R5C40:R140C60,RC12))"
 
Upvote 0
Solution
Try
VBA Code:
        Selection.FormulaR1C1 = "=IF(RC12="""","""",SUMIFS([NBA.xlsm]Favs!R7C44:R142C64,[NBA.xlsm]Favs!R5C40:R140C60,RC12))"
It works. Good catch, the "$".
Thank you.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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