expected: end of statement

jigglypuff

New Member
Joined
Mar 28, 2013
Messages
25
Cells(Target.Row, 2).FormulaR1C1 = "=if Range("a1").Value="","",R[0]C[1]+R[0]C[2])"


I cannot put this code cause it is expected the end of statement at "a1" and I really don't understand why since I use the range("xx") always and I've never had these problems before. Any ideas?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I think it should be
Code:
Cells(Target.Row, 2).FormulaR1C1 = "=if(a1="""","""",R[0]C[1]+R[0]C[2])"
 
Upvote 0
Thank you Michael I also found this solution Cells(Target.Row, 3).Formula = "=IF(G4=""no data"","""","""")" I don't know why I had to duplicate the ""s o_O
 
Upvote 0
Normally the double quotes would be ok in a formula, but once you use them in code they have to be enclosed within double quotes
 
Upvote 0

Forum statistics

Threads
1,214,795
Messages
6,121,624
Members
449,041
Latest member
Postman24

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