6 Replies Latest reply: Nov 13, 2013 3:55 AM by Peter Payne
Ratz0246 Level 1 Level 1
Hi all,

How can I get the row number of a selection if I don't know the range selected? I need it to store in variable.

I've tried in many ways, but unsuccesfully.

Thank's in advance.

Imac, Mac OS X (10.6.6), Numbers 09
Solved by KOENIG Yvan on Feb 9, 2011 8:04 AM Solved
Ratz0246 wrote:
Hi all,

How can I get the row number of a selection if I don't know the range selected? I need it to store in variable.


There is an answer to this question in quite half the scripts which I posted here.

Search for the string *_script AND yvan_* to reach some of them.

Yvan KOENIG (VALLAURIS, France) mercredi 9 février 2011 17:04:12
Reply by KOENIG Yvan on Feb 9, 2011 8:22 AM Helpful
If you already know the document's name, the sheet's name and the table's name, the easy way is :

--

--Here you may replace the three values by the current ones
set dName to 1
set sName to 1
set tName to 1

tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
tell first cell of the selection range to set {rowNum1, columnNum1} to {address of its row, address of its column}
tell last cell of the selection range to set {rowNum2, columnNum2} to {address of its row, address of its column}
end tell
--


Yvan KOENIG (VALLAURIS, France) mercredi 9 février 2011 17:22:21

All replies