Need help with script to automate copying data
I've got a Numbers file with a lot of tabs, each named by year: 2024, 2023, 2022, etc. Within each tab are 6 tables, all identical in format. The tables are named May, June, July, August, September October, respectively. Within each table is a header row, then 31 or 32 rows depending upon month. Column A is integer for day, Col B is max temperature for that day, Col C is average temperature that day, and Col D is min temperature for that day. Last row has word Avg in Col A, followed by average of the max in B, average of the average in C and average of min in D. Example below.
I have another tab called Plots. Within Plots are 2 tables, one with average of max temperatures and the other with the average of the average. Example below
Manually copying the data from the respective tab to the table is tedious. I need help with a script to automate the copying. I'd manually insert a blank row above 2014, for example, and enter 2013 in A2 The script would need to loop through each table in tab 2013 and copy the last entry in Col B from the respective table. Same for a second table named Average Monthly Average Temperature. Repeat the process for 2012 and so on. I don't know enough about Automator to make this happen.
Thanks in advance for the help.
Mac mini, macOS 14.6