• 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: Christopher Stone <email@hidden>
  • Date: Sun, 12 Feb 2017 17:06:45 -0600

Hey Folks,

Sorry about the multiple messages – I only sent it once...

I was asked how I'd discern the table number.

Strangely this information is not part of row or cell properties, so a brute-force method is required.

As far as I can tell the lookup items are found in table-order every time – so as I iterate through the lists to consolidate them, I can add the table number.

I end up with a list of lists again, but so what – it works, and I don't have to monkey with an error-handler (this time).

------------------------------------------------------------------------------

set lookupValue to "125"
set lookupFoundCellList to {}

tell application "Numbers"
   tell document "Test.numbers"
      tell active sheet
         tell tables
            set lookupFoundList to cells where its formatted value is lookupValue
         end tell
      end tell
   end tell

   

   # return lookupFoundList

   

   # Adding the table number into the mix.
   set tableNum to 0
   repeat with ndx1 in lookupFoundList
      set tableNum to tableNum + 1
      repeat with ndx2 in ndx1
         set end of lookupFoundCellList to {contents of ndx2, tableNum}
      end repeat
   end repeat

   

   return lookupFoundCellList

   

end tell

------------------------------------------------------------------------------

--
Best Regards,
Chris

 _______________________________________________
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

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: Multiple messages
  • Next by Date: Re: Shortcut of "Load Remote"
  • Previous by thread: Re: Numbers – Look-Up a Value in a Worksheet
  • Next by thread: Re: Need to run script periodically
  • Index(es):
    • Date
    • Thread