Want to set up spread sheet for 2023 using sheet from sass. Same formulas and headings but no numbers

want to copy 2022 spreadsheet for 2023 but with no numbers. Use same formulas and headings.


iMac (24-inch, M1, 2021, 2 ports)

Posted on Dec 7, 2022 10:53 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 7, 2022 2:39 PM

You would have to save the 2022 version under a new name for 2023.

Then you must delete all inputs, without deleting the formulas.


Option A you delete the inputs manually.


Option B you use this script, it will delete all numbers without deleting the formulas

But you would need to copy this base in your script editor.


tell application "Numbers"

tell front document to tell active sheet

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

repeat with aCell in (get selection range)'s cells

try

tell aCell to if its formula is missing value and ¬

(its value) * 1 is its value then ¬

set its value to ""

end try

end repeat

end tell

end tell

end tell



Script Editor User Guide for Mac - Apple SupportOfficial Apple Support › welcome

Edit scripts with Script Editor on Mac - Apple SupportOfficial Apple Support › guide › script-editor › mac


Ralf


2 replies
Question marked as Top-ranking reply

Dec 7, 2022 2:39 PM in response to budforward

You would have to save the 2022 version under a new name for 2023.

Then you must delete all inputs, without deleting the formulas.


Option A you delete the inputs manually.


Option B you use this script, it will delete all numbers without deleting the formulas

But you would need to copy this base in your script editor.


tell application "Numbers"

tell front document to tell active sheet

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

repeat with aCell in (get selection range)'s cells

try

tell aCell to if its formula is missing value and ¬

(its value) * 1 is its value then ¬

set its value to ""

end try

end repeat

end tell

end tell

end tell



Script Editor User Guide for Mac - Apple SupportOfficial Apple Support › welcome

Edit scripts with Script Editor on Mac - Apple SupportOfficial Apple Support › guide › script-editor › mac


Ralf


Dec 8, 2022 8:31 AM in response to budforward

You can duplicate your document and use this 'Clear Data Leaving Formulas' Shortcut I wrote some time ago.


https://www.icloud.com/shortcuts/f1d9a0bef9a1403bb68688fc9c3e5ba1


It contains a short AppleScript that you can inspect or ignore as you wish.


To activate the Shortcut just click the link above and it should open in Shortcuts app. There you can add it to the menu bar. You can also attach a keyboard shortcut to it.


General information on Shortcuts can be found here:


Shortcuts User Guide for Mac - Apple Support


They can be very useful.


SG








SG


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.

Want to set up spread sheet for 2023 using sheet from sass. Same formulas and headings but no numbers

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