Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
a a is offline
external usenet poster
 
Posts: 51
Default Don't understand why this formula is not working - Help Please!

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
a a is offline
external usenet poster
 
Posts: 51
Default Don't understand why this formula is not working - Help Please!

Thanks, Dave, but perhaps I'm misunderstanding. I changed the formula
to this:


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

But it is still working exactly as I explained in my first post. Is
there something different that I should be doing? As I said, I can
subtract the 11 - but it makes the code much harder to understand.

Thanks again,
Anita


Dave Peterson wrote:

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Don't understand why this formula is not working - Help Please!

I thought that your code didn't put the correct formula in the cell because you
used r1c1 reference style.

But you're asking how R1C1 reference style works.

If you put =R[11]C[5]
into a cell (with R1C1 turned on), it means to go 11 rows down and 5 columns to
the right of the cell containing the formula.

Since you're putting the formula in G11, then it'll be myformula rows down and 5
columns to the right from your G11 cell.

(I'd still use .formular1c1 in the VBA code, though.)

a wrote:

Thanks, Dave, but perhaps I'm misunderstanding. I changed the formula
to this:

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

But it is still working exactly as I explained in my first post. Is
there something different that I should be doing? As I said, I can
subtract the 11 - but it makes the code much harder to understand.

Thanks again,
Anita

Dave Peterson wrote:

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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I don't understand this formula {=TABLE(d19,d21)} - please help Confused in Virginia Excel Worksheet Functions 6 June 1st 07 02:53 PM
I don't understand why the formula doesn't work mmcap Excel Worksheet Functions 3 February 10th 07 10:58 PM
Formula error, don't understand why... duugg Excel Discussion (Misc queries) 2 April 12th 06 06:52 PM
I don't Understand elusiverunner Excel Worksheet Functions 6 November 25th 05 09:19 PM
<> Scooterdog Excel Worksheet Functions 1 November 8th 04 07:56 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"