clear content in cell without loosing formula

Using Numbers V 3.6.1 and trying to clear content of cells, and keep the formula from a previous spreadsheet.

Running 10.11.3 on my mac and tried selecting a row of cells and from file menu hit delete. All cells I selected

cleared. I tested the row with data and none of the cells that had formulas worked.

iMac, OS X Mavericks (10.9.2)

Posted on Feb 19, 2016 1:01 PM

Reply
3 replies

Feb 20, 2016 7:40 AM in response to ragu1086

ragu1086 wrote:


trying to clear content of cells, and keep the formula


A short script can clear all the content in a selected range of cells except formulas, which are left intact.


  1. Copy-paste the script below into Script Editor (in Applications > Utilities folder).
  2. Select a range of cells in Numbers, some of which contain data while other have formulas.
  3. With the cells selected, click the triangle 'run' button in Script Editor.


It's always best to make a copy of your work before performing an operation like this, just in case you do the wrong thing or change your mind.


SG



tell application "Numbers"

tell front document to tell active sheet

tell (first table whose selection range's class is range)

set selRng to selection range

repeat with aCell in selRng's cells

tell aCell to if its formula is missing value then ¬

set its value to ""

end repeat

end tell

end tell

end tell

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.

clear content in cell without loosing formula

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