Le 10 févr. 2017 à 20:05, Christopher Stone < email@hidden> a écrit :
On Feb 10, 2017, at 05:45, Yvan KOENIG < email@hidden> wrote: (1) the instruction set theRow to theCell's row is useless
Hey Yvan,
That was supposed to be:
set rowNum to theCell's row's address
I must have pasted from an earlier attempt.
(2) The instruction tell tables lets think that the script search in every table available in the current sheet. It doesn't.
Zoiks! Sure enough. Doing that reveals an oddity. length of theCell = 1 is accepted when the script use tell tables, it's not when it use tell table 1. It's due to the fact that the functions count and length aren't completely identical. If I replace length theCell = 1 by (count theCell) = 1 the script works.
That's happening, because theCells is no longer a list.
I'll just replace it with this:
set theCell to cells whose formatted value is lookupValue
Because I'll want to be able to catch instances if/when the lookup value is in the table more than once. Thanks.
Hello
So if I understand well you would use :
set lookup to 125 # why not
tell application "Numbers" tell document "Some Document" tell active sheet tell table 1 set theCells to cells whose formatted value is lookup
if theCells ≠ {} then # we never get {missing value} repeat with theCell in theCells set theRow to theCell's row's address # At this time it's always useless set selection range to theCell # Do what you want with the selected cell end repeat end if end tell end tell end tell end tell
Yvan KOENIG running Sierra 10.12.3 in French (VALLAURIS, France) vendredi 10 février 2017 20:51:17
|