ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   use of integer in .FormulaR1C1 (https://www.excelbanter.com/excel-programming/437431-re-use-integer-formular1c1.html)

Caroline

use of integer in .FormulaR1C1
 
Dropping the []'s from the formular1c1 string was the answer.
Thanks a million

--
caroline


"Dave Peterson" wrote:

Try dropping the []'s from your formular1c1 string.

If that doesn't help, create the formula manually in the worksheet cell.

Then turn on R1C1 reference style (if it's not turned on).

If you can't get your code to create this formula, then copy the formula and
paste into your followup message.

In this case (because you're using named ranges), there won't be a difference
between R1C1 reference formular1c1 and the A1 reference formula. (Well, unless
I guessed wrong at what you were doing.)

caroline wrote:

hello,
I used integer A and B in formula such as
.FormulaR1C1 = "=R[" & -A & "]C*R[" & -B & "]C"
and it works fine
How can I use the same principle for the following:
.FormulaR1C1 = "=INDEX(RangeX,[" & A &"],MATCH(YearEnd,Years,0))"
[" & A &"] does not seem to be recognised

PS: it is important that I use .FormulaR1C1 as my user needs to see the
formula used.

Thanks a lot.
--
caroline


--

Dave Peterson
.



All times are GMT +1. The time now is 01:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com