Can you do macros in Apple Numbers?

From the looks of one of your screenshots, your version of Numbers appears to be different from mine, because the dialog boxes don't look the same. So you may not be able to use my solution without some modification. But here's what works for me. Please note that I inserted a "wait 0.5 seconds between each action" at the top, which can be removed once this macro's timing issues, if any, are debugged. This example only adds a single filter, but it may give you the ideas you need to make it work for your own filter. I noticed in your example above you had a filter for "fruit = 2" but I think you made a mistake there because the fruit columns contains only fruit names, not numbers.

You may notice that I used offsets in my Mouse actions. I do this to help guarantee the accuracy of the mouse click actions. There are many ways to solve this and I'm not saying my way is the only way, but I tend to use reliable ways. You may have to change the offsets depending on your monitor's resolution or your screen scaling. But this should give you an idea of how to get it to work.

Group.kmactions (22 KB)

Can you do macros in Apple Numbers?

I have an old video on that, but it is much the same today. You use Automator. https://macmost.com/using-automator-to-playback-actions.html.

Keep in mind that Automator records all Mac actions, whereas an Excel macro is just for Excel. So they ate very different things.

If there is something specific you are trying to accomplish in Numbers, ask about that. You may not need to record actions at all to do it.

If you use spreadsheets a lot, you've probably used a mini-program to automate functions in your spreadsheet. These custom macros (or scripts) are frequently programmed into Microsoft Excel spreadsheets, as they can handle complex calculations that simple spreadsheet formulas can't. Macros are written in a programming language called Visual Basic for Applications (VBA). Unfortunately, Apple's spreadsheet application, Numbers, can't read macros that are written in VBA. If you have Apple's iWork 09, however, there are a few options you can try if you still want to use macros in your spreadsheets.

Advertisement

Step 1

Use AppleScript to create your spreadsheet macros. This is the built-in Mac OS X scripting language. All iWork '09 applications, including Numbers, support the use of AppleScript.

Video of the Day

Step 2

Switch to using the previous version of Excel for Mac. Excel 2004 supports the use of VBA macros.

Advertisement

Step 3

Convert your Numbers '09 spreadsheet to a Windows Excel spreadsheet format. Open your Numbers spreadsheet, and click "File," then "Save As." Select "Save copy as," and choose Excel Document from the pop-up menu. You can now apply macros to the spreadsheet by opening the spreadsheet with a Windows version of Excel.

So, when I need to change something in this formula, I need to edit each one of then. So to avoid this kind of duplication, can I create something like a macro, which will make me able to do something like that:

def myMacro($POS):
  return SE($POS<60; DEF.NÚM.DEC(SOMA(60; −$POS); 1); "✔︎ Aprovado")

And use it like:

=myMacro(N17)

Note: The formulas are in portuguese.

Thanks - helpful - I want to edit a daily report that I get from a card provider to get rid of the many columns which are of no use to me - then reformat the report and produce a graph from the data. At the moment this takes time and effort that I'm sure I should be able to automate. Was trying to use Automator but will have a go now with AppleScript - which do you htink si best ? that or JavaScript for Automation? Thanks again for your rapid answer to my question.

Show more Less

Reply Helpful

Link

I run a league and have a number of teams with results per team. In excel I can run a series of steps that copy the team totals to a table and then sort that table for score and then shot difference. In Excel that is called recording a Macro. You then name the macro and can trigger by attaching it to a button on the page. It simply avoids errors and makes the task simpler. If all this is not possible in Numbers see next paragraph.

In apple Numbers can I make live link copy and paste from one worksheet to another so that any changes to the data entry in sheet one then appears on the second sheet. That second sheet table would then only need to be sorted. Can I do a two stage sort in Numbers, that is sort by the column headed Score and then by the column headed Shot difference.

How do I enable macros in Mac Numbers?

Enable or disable macros in Office for Mac.
Click the Word, Excel, or PowerPoint menu as appropriate..
Click Preferences..
Click Security & Privacy. To allow all macros to run select the Enable all macros radio button. Caution: This will allow ALL macros, both good and bad, to run without any further warning..

Can you use VBA on Apple numbers?

VBA works very well in Excel for the Mac. AppleScript and JavaScript for Automation (JXA) work well with Numbers, but you can't run them on Windows.

Can you run a macro on a Mac?

To automate a repetitive task so that you can do the task again with a single click, you can use the Developer tab in Excel for Mac to record and run a macro. You can also create a macro by using the Visual Basic Editor in Microsoft Visual Basic for Applications (VBA) to write your own macro programming code.

Can you do formulas in Apple numbers?

You can create formula or function cells that automatically perform calculations using the data in any cells you select.