How to delete certain cells from Numbers? So I have a large dataset with a lot of &quot;noise&quot; in it. I need to get rid of all these cells that have either &quot;-999&quot; in it or &quot;888&quot;.
How can I programmatically do that using the numbers app so I am not doing this all day long?
The following example AppleScript code is one way to achieve what you are asking:
tell application &quot;Numbers&quot;
    tell document 1
        tell sheet 1
            tell table 1
                set the targetCells to a reference to (cells whose value is -999)
                set the value of the targetCells to &quot;&quot;
                set the targetCells to a reference to (cells whose value is 888)
                set the value of the targetCells to &quot;&quot;
            end tell
        end tell
    end tell
end tell


Notes:
The example AppleScript code, was tested in Script Editor under macOS Catalina with Language &amp; Region settings in System Preferences set to English (US) — Primary and worked for me without issue1.

1  Assumes necessary and appropriate setting in System Preferences &gt; Security &amp; Privacy &gt; Privacy have been set/addressed as needed.


Note: The example AppleScript code is just that and sans any included error handling does not contain any additional error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g. delay 0.5, with the value of the delay set appropriately.