• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Numbers – Look-Up a Value in a Worksheet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Numbers – Look-Up a Value in a Worksheet


  • Subject: Re: Numbers – Look-Up a Value in a Worksheet
  • From: Yvan KOENIG <email@hidden>
  • Date: Fri, 10 Feb 2017 20:51:21 +0100


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


 _______________________________________________
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: Numbers – Look-Up a Value in a Worksheet
      • From: Christopher Stone <email@hidden>
References: 
 >Numbers – Look-Up a Value in a Worksheet (From: Christopher Stone <email@hidden>)
 >Re: Numbers – Look-Up a Value in a Worksheet (From: Yvan KOENIG <email@hidden>)
 >Re: Numbers – Look-Up a Value in a Worksheet (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Numbers – Look-Up a Value in a Worksheet
  • Next by Date: Re: Numbers – Look-Up a Value in a Worksheet
  • Previous by thread: Re: Numbers – Look-Up a Value in a Worksheet
  • Next by thread: Re: Numbers – Look-Up a Value in a Worksheet
  • Index(es):
    • Date
    • Thread