I do have some knowledge of vb in xl but as I said Earlier new to numbers , I have tried and and get a copy of a single line from Premier to selections. I have tried to read for all lines but getting error message "Numbers got an error: Can’t get sheet \"Premier\" of table \"Selections\" of sheet \"Selections\" of document 1." number -1728 from sheet "Premier" of table "Selections" of sheet "Selections" of document 1. I have attached the code and added a new bit if you could help?
tell application "Numbers"
activate
set thresholdText to text returned of (display dialog "Enter percentage threshold:" default answer "60")
set thresholdValue to thresholdText as number
set leagues to {"Premier", "Championship", "League1", "League2"}
tell front document
tell sheet "Selections"
tell table "Selections"
--repeat with leagues
tell sheet (leagues as text)
tell table "DATA"
set lastRow to row count
repeat with r from 8 to lastRow
set teamName to value of cell 1 of row r
if teamName is not missing value and teamName is not "" then
set pctValue to value of cell 5 of row r
-- handle % formats (0.60 or 60)
if pctValue < 1 then
set pctCompare to pctValue * 100
else
set pctCompare to pctValue
end if
if pctCompare > thresholdValue then
tell table "Selections" of sheet "Selections"
add row below last row
set newRow to row count
-- Date
set value of cell 1 of row newRow to ((current date) as text)
-- League
set value of cell 2 of row newRow to (leagues as text)
-- Copy A:P → C:R
repeat with c from 1 to 16
set value of cell (c + 2) of row newRow ¬
to value of cell c of row r
end repeat
end tell
end if
end if
end repeat
end tell
end tell
end tell
end tell
end tell
end tell