Syntax question

bradyj7

Board Regular
Joined
Mar 2, 2011
Messages
106
Hi,

How do you reference variables properly in formular1c1 function. I have some code below which is incorrect

Code:
Range("p2:p" & LastRow).FormulaR1C1 = "=((1080*9.81*sin(rc[-3])*"&l2&")-(9.81*1080*"&h&" *cos(rc[-3]))

Thanks
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Well there's a closing quote missing and I think a closing parenthesis missing too. Did you mis-paste the line perhaps?

Apart from that, if your variables are called l2 and h, that looks okay... except I would put spaces around the & characters.

What makes you say it's incorrect?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,526
Messages
6,179,322
Members
452,906
Latest member
Belthazar

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