Re: R1C1
Re: R1C1
- Subject: Re: R1C1
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 14 Jul 2009 08:06:52 -0700
- Thread-topic: R1C1
Title: Re: R1C1
Take advantage of the 'get address' command:
set myVariableNumberOfCells to 12
tell application "Microsoft Excel"
set endAddress to get address (cell myVariableNumberOfCells of row 1) without row absolute and column absolute
range ("A1:" & endAddress)
end tell
--> range "A1:L1"
If you don't mind seeing the "$L$1" absolute terminology (it's just going to be the same range anyway) save yourself some typing:
set myVariableNumberOfCells to 12
tell application "Microsoft Excel"
set endAddress to get address (cell myVariableNumberOfCells of row 1)
range ("A1:" & endAddress)
end tell
--> range "A1:$L$1"
(If you really want to ensure absolute cells, use "$A$1" yourself.)
--
Paul Berkowitz
> From: Frank Renner <email@hidden>
> Date: Tue, 14 Jul 2009 12:12:30 +0200
> To: AppleScript-Users <email@hidden>
> Subject: R1C1
>
> Hi,
>
> I have been carefully reading the Excel AppleScript Reference and many
> of the threads of this list, but still can't sort this out in my head.
>
> If I have to select or fill a variable number of cells. This would be
> easy in R1C1 notation as all I would have to do is build a range like
>
> "R1C1:R1C" & (myVariableNumberOfCells as string)
>
> As this (the "R1C1" notation) doesn't seem to work any more...how is
> it achieved in the A1 notation? Do I really have to "translate" like
> "1 is A", "2 is B" and so on or is there an easier way?
>
> Frank Renner
> _______________________________________________
> 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
- Follow-Ups:
- Re: R1C1
- From: Paul Berkowitz <email@hidden>
References: | |
| >R1C1 (From: Frank Renner <email@hidden>) |