AppleScript in Numbers

I am a TOTAL beginner here so I’m hoping someone can help. I have changed up some script I found on the internet for Google Sheets documents before to get it to do what I needed but never on a mac in Numbers. I am trying to have Numbers automatically copy and paste rows from one sheet to another when a particular column has a specific number in it. For example: I have a list of names that I will assign a table number to. My hopes are that once I assign that person a table number I can have Numbers automatically copy and paste that persons row of information onto that table numbers own sheet as a roster. So I would have a master list of everyones name that would essentially create a list of the people at each table on separate sheets. Any help is greatly appreciated!

MacBook Air

Posted on Oct 31, 2019 8:58 AM

Reply
6 replies

Oct 31, 2019 12:44 PM in response to Lacey428

Done. I did it slightly differently than how I suggested. This allowed me to do it with only one calculation column added.



First I created a reference number for each person like this. Format is their table number, then a dash, then a number which counts how many people are at that table above them on the list, including them. Each reference number is unique.



Then I generated a list of references for each table in your table.... tables. 😂. This is the formula I used for that.



And finally, I used INDEX/MATCH to match each person with their reference number. Note the column reference. If you want to move all of their data over, just use the same formula in the other columns, but change the column reference. The first reference (Table 1::$A$Table Ref) is your index range. Using 1 as a column reference will return the value in the first column of that range. Using 2 will return the value of the second column, and so on.


I left the Table Ref column visible so you can see what I did, but you’re free to go ahead and set it to Hidden. Numbers will refer to it, but you don’t have to.

Oct 31, 2019 11:08 AM in response to Bismarck2387

Now that I think on it, the above will most definitely work for what you are hoping to achieve. The fundamental difference is the criteria to create the search string, or reference number. Assuming table # is in column C, your formula for a hidden calculation column, (column H) for table 1 would be:


H10=IF(C10=1),MAX(H$2:H9)+1,0)


Column I would be a calculation column for table 2, and it’s formula would be:


I10=IF(C10=2),MAX(I$2:I9)+1,0)


And so on for the other tables. Then it’s just a matter of creating a separate table for each, uhhhh, table, adding the numbers 1-X in one column of each table, and then look up the corresponding guests from the main list.


Let me know if you still need any help.


Oct 31, 2019 10:41 AM in response to Lacey428

Numbers is not set up to do this sort of thing, but a workaround should be possible. I think advice I gave someone else earlier, to have Numbers sort one master list into several smaller lists, will apply in this case. You should be able to adapt this to your purposes:


https://www.icloud.com/numbers/0B8NgCoEMo6aacsPtuStw-YnA#Blank_26



It’s not quite the same thing, but you should be able to adapt the concept. Once you’ve moved one piece of data over to the new list, based on whatever criteria you apply, you can use LOOKUP, VLOOKUP, or INDEX/MATCH to move it all over.

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.

AppleScript in Numbers

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