Create a Link to take to you to a specific part of a Numbers Document (to a chart)

I would like to create a table (pls see image of yellow tabled data) that when you click on a cell in it, it takes you to a chart within a Numbers sheet.


Referring to this discussion about creating links to jump around a document: Numbers - link or jump to sheet - Apple Community -- is there any way to create a link to take to you to a specific part of a Numbers document?


I understand there is a link to Sheet option (enter text in a cell, two finger click and choose link) but I need to link to a specific cell(s), namely the top left cell of each of many, many charts I have created in the same sheet?



Any help much appreciated!


MacBook Pro 15″, macOS 12.3

Posted on Apr 13, 2024 1:44 AM

Reply
2 replies

Apr 13, 2024 7:59 AM in response to Bardonicloud

The best I have is an AppleScript that will take you to a specific cell (or table) anywhere in the document. Here is a way you can use it:


  1. On the sheet that has all your charts, create a table that goes the full length of the sheet. It can be a single column. It should go the full length of the sheet so it is next to every chart. If you have two or more columns of charts you might want two or more tables or you can use a wider table (more than one column).
  2. Write down the addresses of the cells that you want to jump to for each chart (such as Sheet 2::Table 1::A23)
  3. In the table where you want links to the charts, enter those addresses (as text).
  4. Select one of those cells then run the AppleScript provided below (for now run it from the Script app).
  5. You can "hide" the other table by removing features and setting things to white or no color.


-- 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

Create a Link to take to you to a specific part of a Numbers Document (to a chart)

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