MacOS – Can numbers copy spreadsheet including formula and paste without the figures

macosnumbers

I use the Mac Numbers app (version 5.1) on a retina MacBook Pro, Safari 11.1.2

I need to copy & paste a spreadsheet to include the formulae, but not the figures?

Spefically, my accounts for July, with all the relevant formulae and I want to use the same layout – and, in general, the same formulae, but not the same figures – for my accounts for August. Up to now, I have copied & pasted the spreadsheet, then deleted the information in the relevant cells – but this also deletes the formulae.

Best Answer

The simplest way is to keep the data column separate from formula column, then just delete the data.

For more automated action I found this answer for you..

A short script can clear all the content in a selected range of cells except formulas, which are left intact. First use the File->Duplicate in Numbers to create a copy.

Next step... Copy-paste the script below into Script Editor (in Applications > Utilities folder). Select a range of cells in Numbers, some of which contain data while other have formulas. 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.

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

data formula