View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default Don't understand why this formula is not working - Help Please!

Since you're giving a formula in R1C1 reference style, you should use
..formulaR1C1 instead of .formula.

Sheets(notePad).Range("g11").FormulaR1C1 = "=xxxx!R[" & myFormula & "]c[5]"

a wrote:

Hi,

I have a weird issue. I have a sheet that looks at a column to pull the
variable "notepad". I have no issue with that. It also goes one column
over to pull the row number on my summary sheet - which is called "xxxx".

The problem is this - the column on the formula I am trying to link is
"L" - 5 columns over from "G". The myFormula variable is the row
related to my notepad on the summary page - but if I use the correct row
- it will be 11 rows greater in the formula than what it should be.

I can make this work by just subtracting 11 from myFormula - but I just
want to know why it it references the "g" and the 11 in the range where
I want the formula to go.

Can anybody help? I find this very strange.

Sheets(notePad).Range("g11").Formula = "=xxxx!R[" & myFormula & "]c[5]"

Thanks much in advance,
Anita


--

Dave Peterson