In Numbers, how to target empty cells and replace with text

Leaving the find field empty disables "replace" to be able to add text to all empty fields. A use case would be to replace emptiness with the word "none".


I found this 2010 era workaround, but the instructions about where to put the script leads to dead ends, so I assume things in the MacOS have changed 13 years later.

find and replace on empty cells - Apple Community


What is the best way to do this in Sonoma?


MacBook Pro (2017 – 2020)

Posted on Nov 5, 2023 01:45 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 5, 2023 02:20 PM

Follow these instructions for installing the script.


This is very basic, it will only fill the selected cells (a whole table if you want).


set temp to display dialog "Replacement value" default answer ""
if button returned of temp is "OK" then
	set replacementText to text returned of temp
	tell application "Numbers"
		tell every table of active sheet of front document
			tell selection range
				set (value of cells whose value is missing value) to replacementText
			end tell
		end tell
	end tell
end if



2 replies
Question marked as Top-ranking reply

Nov 5, 2023 02:20 PM in response to PTboy

Follow these instructions for installing the script.


This is very basic, it will only fill the selected cells (a whole table if you want).


set temp to display dialog "Replacement value" default answer ""
if button returned of temp is "OK" then
	set replacementText to text returned of temp
	tell application "Numbers"
		tell every table of active sheet of front document
			tell selection range
				set (value of cells whose value is missing value) to replacementText
			end tell
		end tell
	end tell
end if



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.

In Numbers, how to target empty cells and replace with text

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