Re: Excel
Re: Excel
- Subject: Re: Excel
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 08 Feb 2009 12:14:15 -0800
- Thread-topic: Excel
Title: Re: Excel
On 2/8/09 11:44 AM, "Deivy Marck Petrescu" <email@hidden> wrote:
I don't understand what you're working with here. Nor do I understand where the R3 comes from in the first statement of the script. What is "RC[-1]" meant to indicate and how does it end up as "R3" in the first example and as "RC[-1]" in the second example?
I don't know about the newer versions, but in excel X, you can refer to cell "A1" as "A1" or as "R1C1", the latter means "row 1 column 1".
The R1C1 cell-address terminology cannot be used in Excel 2004 or 2008. Only the A1 terminology.
So, to put the value in any cell, one can select either is customary excel name, "B1", Z10" or the location by row and column.
One problem is everything is fine except for cells like "Cn" or "Rn" where n is a number. This, because excel understands those as "Column n" or "Row n".
No longer a problem. It is unambiguous now with the absence of R1C1 addressing. C3 just means the cell "C3".
Now suppose I select cell "A1" and I want to have "B1" as the same value of "A1".
I can write the following,
------> set value of Cell "B1" to "=A1"
This will translate in a B1 cell as =$A$1.
Where the "$" indicates absolute reference. So if I drag down the value of cell "B1" to have the value of "B2" = "A2", I would get instead "B2"="A1".
However, if if instead of the line above I use
------> set value of Cell "B1" to "=RC[1]"
This will translate it to "=A1" as a referencial position, instead of absolute position. That is, dragging down B1 would make "B2" = "A2" and so on.
In other words, RC[1] means: the same row but next column. R[-2]C[2] means: 2 rows before the current row and 2 columns after the current column.
You can't do that any longer, as you'll realize by now. There are other ways of getting relative positions, including the 'get offset' command:
set value of cell "B1" to (get value of (get offset cell "B1" column offset 1))
set value of cell "B1" to (get value of (get offset cell "B1" row offset -2 column offset -2))
Unambiguous. Always works (but note that it needs the explicit 'get' or a variable).
For someone not too familiar with =LOOKUP function, could you please describe what values are actually in T2:U6, what value you're trying to find ("RC[-1]" literally or something else?) and what exactly you would enter in the UI and what result you get, that you're trying to do by script. Thanks.
T2:U6 is a range of cells. The first cell is on "T2", the last in "U6".
This means the range t2,t3,t4,t5,t6, u2,u3,u4,u5,u6. A bicolumnar range with 10 cells.
U2:U6 is a columnar reference to these five cells range.
There is no UI scripting everything is excel scripting.
So, the R3 is right (I entered RC[-1] in S3, same row one column before), I d not understand why the -- ' -- show up. They were not supposed to be there.
I know all that. I'm asking you to give me an example of what you want to do, beginning with your actual values in the T2:U6 range, describing what you'd enter in the UI (not GUI scripting - just regular old Excel UI), what result you end up with, so I can attempt to script it using new Excel scripting in 2008.
--
Paul Berkowitz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
References: | |
| >Re: Excel (From: Deivy Marck Petrescu <email@hidden>) |