Conditional highlighting using a formula

In Word for Mac, we can highlight cells based on a formula. Is there a way to get the same in Numbers,too?

MacBook Pro with Retina display, OS X Mavericks (10.9.4), iPhone 4S

Posted on Sep 6, 2014 5:41 PM

Reply
33 replies

Sep 13, 2014 7:11 PM in response to Naikosen

Yes, AppleScript can be handy for doing certain things in Numbers.


I haven't built any error trapping into the script (that takes time and I wasn't sure whether the script would be useful on your end). I don't get the error here and am not sure what is causing it though I'm guessing you may have a non-number somewhere in columns D through F. Try clearing the error up with a 'try' and 'end try', as in the variation below ('try' tells AppleScript what to do when it encounters an error, much like IFERROR in Numbers).


SG



property startCol : 4

property endCol : 6

tell application "Numbers"

set t to front document's active sheet's first table whose selection range's class is range

tell t to repeat with r from (1 + header row count) to (row count - footer row count)

set rv to row r's cells's value

set v to rv'sitemsstartCol thru endCol

if my sumList(v) = 0 then set row r's cells startCol thru endCol's text color to "white"

end repeat

end tell


to sumList(lst)

set sum to 0

repeat with i in lst

try

if i is not "missing value" then set sum to sum + i

end try

end repeat

end sumList

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Conditional highlighting using a formula

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.