Navigate to a table cell through a link

I’ve been able to set up links to navigate to a sheet, but would like to do the same to a particular table. The link would be on a summary worksheet that pulls totals by formulas from separate sheets/tables. Some of those sheets have multiple tables. The formulas bring in the amounts just fine, but I want a type of drill down. Hope that makes sense.

iPad, iOS 10

Posted on Mar 8, 2024 1:55 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 8, 2024 2:22 PM

It is not part of Numbers. Below is a script that can do something similar. To use it you to select (click on) a cell that has the "link" then use a keyboard shortcut to make the jump. If you want to try it out,

  1. Open the Script Editor App,
  2. Paste the script into it,
  3. Set up your table as described in the comments in the script
  4. Click on the cell with the "link"
  5. Hit the Play button in Script Editor to run the script


If you like it, I will give instructions on how to turn it into a "Quick Action" / Service and assign a keyboard shortcut to it. Or I can post a link to it as a Mac OS shortcut. I've not tried to use it as a shortcut before so I'll have to try that out first.


-- Goto Numbers Cell
-- In a cell in a table will be text of the form sheetname::tablename::cellname
-- such as Sheet 1::Table 1::D4
-- Select the cell then run the script and the focus should move to the specified cell.
-- Alternatively, the cell may contain sheet and table name without the cell name
-- such as Sheet 1::Table 1
-- In this case the focus will move to cell A1 of the specified table



tell application "Numbers"
	tell front document
		tell active sheet
			tell (first table whose selection range's class is range)
				set linktext to (value of first cell of (selection range)'s cells as text)
			end tell
		end tell
		
		set myArray to my theSplit(linktext, "::")
		
		set active sheet to sheet (item 1 of myArray)
		tell active sheet to tell table (item 2 of myArray)
			if number of items of myArray = 3 then
				set selection range to cell (item 3 of myArray)
			else
				set selection range to cell "A1"
			end if
		end tell
		
	end tell
end tell


on theSplit(theString, theDelimiter)
	-- save delimiters to restore old settings
	set oldDelimiters to AppleScript's text item delimiters
	-- set delimiters to delimiter to be used
	set AppleScript's text item delimiters to theDelimiter
	-- create the array
	set theArray to every text item of theString
	-- restore the old setting
	set AppleScript's text item delimiters to oldDelimiters
	-- return the result
	return theArray
end theSplit

Similar questions

5 replies
Question marked as Top-ranking reply

Mar 8, 2024 2:22 PM in response to JC Hilderbrandt

It is not part of Numbers. Below is a script that can do something similar. To use it you to select (click on) a cell that has the "link" then use a keyboard shortcut to make the jump. If you want to try it out,

  1. Open the Script Editor App,
  2. Paste the script into it,
  3. Set up your table as described in the comments in the script
  4. Click on the cell with the "link"
  5. Hit the Play button in Script Editor to run the script


If you like it, I will give instructions on how to turn it into a "Quick Action" / Service and assign a keyboard shortcut to it. Or I can post a link to it as a Mac OS shortcut. I've not tried to use it as a shortcut before so I'll have to try that out first.


-- Goto Numbers Cell
-- In a cell in a table will be text of the form sheetname::tablename::cellname
-- such as Sheet 1::Table 1::D4
-- Select the cell then run the script and the focus should move to the specified cell.
-- Alternatively, the cell may contain sheet and table name without the cell name
-- such as Sheet 1::Table 1
-- In this case the focus will move to cell A1 of the specified table



tell application "Numbers"
	tell front document
		tell active sheet
			tell (first table whose selection range's class is range)
				set linktext to (value of first cell of (selection range)'s cells as text)
			end tell
		end tell
		
		set myArray to my theSplit(linktext, "::")
		
		set active sheet to sheet (item 1 of myArray)
		tell active sheet to tell table (item 2 of myArray)
			if number of items of myArray = 3 then
				set selection range to cell (item 3 of myArray)
			else
				set selection range to cell "A1"
			end if
		end tell
		
	end tell
end tell


on theSplit(theString, theDelimiter)
	-- save delimiters to restore old settings
	set oldDelimiters to AppleScript's text item delimiters
	-- set delimiters to delimiter to be used
	set AppleScript's text item delimiters to theDelimiter
	-- create the array
	set theArray to every text item of theString
	-- restore the old setting
	set AppleScript's text item delimiters to oldDelimiters
	-- return the result
	return theArray
end theSplit

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.

Navigate to a table cell through a link

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