I have a Numbers sheet that is thousands of rows long. As an example in the image, the sheet has two columns with URLs. What I need to do is find the rows that have the same URL in the two adjacent cells and then change the background color of that row so I can identify the rows and delete them; or write the word "dupe" to column C. In the example, row 4 has the same URL the two cells. How would I flag or mark rows like that in the entire sheet? With a calculation? Or an Applescript/Automator?
How to find duplicate adjacent cells in Numbers
applescriptautomationiworknumbers
Best Answer
Here is an AppleScript method, which demonstrates three different types of action taken upon the rows with duplicate cell entries in
columns "A"
and"B"
(equivalent tocells 1
and2
):I've defined three handlers,
highlight()
,comment()
, anddelete
, each of which, if called, will perform a particular action upon the rows of interest. Currently, you can see in the script a few lines within the section labelledIMPLEMENTATION:
that I've set it currently to perform thehighlight()
action, which will change the particular rows' background colour to a shade of pink I like.Below that line are commands that I have commented out using
--
, so currently they remain inert. When uncommented, thecomment()
handler will enter the word"SNAP!"
into the third column of each row of interest; and thedelete
command (note the lack of parentheses for this one) will simply delete the rows completely. I've marked this with a warning that implies permanent deletion, although in truth, you can recall the rows back into existence using the application's builtin Undo menu item, or ⌘Z (on a one-by-one basis!)