FormulaR1C1 returning nothing when using a variable

Zem32619

New Member
Joined
Jul 2, 2021
Messages
29
Office Version
  1. 365
Platform
  1. Windows
Hi All.

I have a code that works perfectly fine for users with the US excel and windows setting. I'm stuck why FormulaR1C1 doesn't work as it should when ran in a German setting.
Here is the line of code that works for US setting.

Range("L2").FormulaR1C1 = "=(1-(RC[14])- " & ACoS & " ))*RC[-1]"

But it returns nothing, as in empty when ran in a German setting. I'm thinking if it is the variable thing "ACoS".

Would really appreciate any help. Thank you so much in advance.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Does replacing FormulaR1C1 with FormulaR1C1LOCAL make any difference?
 
Upvote 0
I might be misunderstanding, but there doesn't seem to be a cell reference for Acos...shouldn't it be Acos(cell reference)
 
Upvote 0
Can you enter these two formulas into two cells (on the German version) and tell me what they come back with
Excel Formula:
=LEFT(ADDRESS(1;1;1;0);1)

=MID(ADDRESS(1;1;1;0);3;1)
 
Upvote 0
Can you enter these two formulas into two cells (on the German version) and tell me what they come back with
Excel Formula:
=LEFT(ADDRESS(1;1;1;0);1)

=MID(ADDRESS(1;1;1;0);3;1)

=LEFT(ADDRESS(1;1;1;0);1) = R
=MID(ADDRESS(1;1;1;0);3;1) = C
 
Upvote 0
Hi All.

I have a code that works perfectly fine for users with the US excel and windows setting. I'm stuck why FormulaR1C1 doesn't work as it should when ran in a German setting.
Here is the line of code that works for US setting.

Range("L2").FormulaR1C1 = "=(1-(RC[14])- " & ACoS & " ))*RC[-1]"

But it returns nothing, as in empty when ran in a German setting. I'm thinking if it is the variable thing "ACoS".

Would really appreciate any help. Thank you so much in advance.
Also, if I put a fixed number in the formula, say 30%, instead of variable "ACoS", it works as it should.
 
Upvote 0
I think you need to rename the variable...ACos is a native function of Excel, so shouldn't be used.
So I'm guessing the code is misreading it as an Excel function
"The ACOS function returns the inverse cosine of a number. The function is the inverse of COS and expects input in the range from -1 to 1."
 
Upvote 0
I think you need to rename the variable...ACos is a native function of Excel, so shouldn't be used.
So I'm guessing the code is misreading it as an Excel function
"The ACOS function returns the inverse cosine of a number. The function is the inverse of COS and expects input in the range from -1 to 1."
HI Michael.

Thanks for your reply. I tried changing the variable name and it gives me the same problem.
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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