Re: Canonical way to extract row number from a cell reference
Re: Canonical way to extract row number from a cell reference
- Subject: Re: Canonical way to extract row number from a cell reference
- From: Alastair Leith <email@hidden>
- Date: Mon, 17 Mar 2014 14:52:59 +1100
Axel
That's a good comprehensive answer. :-) Many Thanks from an often frustrated AS student!
On 15 Mar 2014, at 8:52 pm, Axel Luttgens <email@hidden> wrote:
> Le 15 mars 2014 à 06:34, Alastair Leith a écrit :
>
>> tell application "Microsoft Excel"
>> set ac to get address of active cell
>> set rw to last word of ac #win ugly
>> log ("Active cell: " & ac & return & "Row from Active Cell: " & rw)
>> end tell
>>
>>
>> Is there a less ugly way to pull the column or row number from a cell reference than using words as per line 3.
>
> Hello Alastair,
>
> You're probably looking for this one:
>
> set rw to first column index of active cell
>
>
>> Also how can one construct a cell reference programatically to columns (rows are easy because they are integer values?
>>
>> set col to column (1)
>> set col1 to get address of col
>> set col2 to second word of col1
>> set rw to 54
>> set r to range (col2 & rw)
>> log value of r
>>
>> Is there a cleaner way to turn a integer into a column reference than above?
>
> Let's say you're interested in cell at third row and fourth column (in your example, this was cell at row 54 and column 1); all of these seem to be valid ways to refer to that cell:
>
> row 3 of column 4
> column 4 of row 3
> cell 3 of column 4
> cell 4 of row 3
>
> Now, if you want a range object, command "get offset" may be applied to each of the above; for example:
>
> get offset row 3 of column 4
>
> Another way to get that range is to start with the sheet's top-left cell:
>
> get offset cell "A1" row offset 3 column offset 4
>
> And so on...
>
> Axel
>
>
> _______________________________________________
> 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
_______________________________________________
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