I would like to set a selected range of cells in a Apple Numbers sheet, where I always want the range to extend down to all but the last 3 rows. The issue is I do not know the number of rows in any sheet. I have seen how to select ranges at AppleScript and Numbers: Defining and Selecting Ranges, but it does not help with my issue.
I have got part of the way in doing a script but I just cannot find the syntax to get the AppleScript to work. Here is where I have got up to:
tell application "Numbers"
tell first table of the active sheet of the front document
set countofcells to count of cells of column 2
set countofcells to countofcells - 3
set thisRangeName to ¬
((name of the second cell of column "B") & ":" & ¬
((name of the 51st cell of column "B")))
set the selection range to range thisRangeName
end tell
end tell
The part of the script I am having the problem is the line
“((name of the 51st cell of column “B”)))”
as not every sheet will the last row which needs selecting in Column B be the 51st cell.
Any help would be gratefullly received.