You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Hyperlink in one cell scrolls/moves your view to another cell in the same sheet

I'd like to add a hyperlink to some text in a cell that when clicked it would shift or move the view from that cell to whatever other cell in the same sheet.

For example, clicking on text in cell B20 would shift/scroll/move the view to cell AQ11.

Can I do this in numbers?

I think in Excel I would use "anchors" for this, not sure, but is there something comparable in Numbers?

Many thanks in advance!

Posted on Sep 24, 2024 2:25 PM

Reply
4 replies

Sep 24, 2024 7:17 PM in response to Badunit

Here is an alternate version that will go to and select a single cell (same as the other script) or a range of cells. It might be handy if you have a need to jump to a range of cells and copy them or paste something into them


-- Goto Numbers Cell
-- In a cell in a table will be text of the form sheetname::tablename::rangename
-- such as Sheet 1::Table 1::B2 to go to and select a single cell
-- or Sheet 1::Table 1::B2:D5 to go to and select a range of cells 
-- 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
-- 2024-09-24

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 range (item 3 of myArray)
			else
				set selection range to range "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

Sep 24, 2024 6:33 PM in response to Ponderosa

The built-in functionality of Numbers will allow you to make a hyperlink to another sheet but not to a specific table or cell. Below is an AppleScript that will do it, though.


You can use Automator to turn a script into a service and then use System Preferences to give it a keyboard shortcut. Or you can make the script into a shortcut (Shortcut app) but I've never been successful assigning a keyboard shortcut to one and having it work.


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


These are the basic instructions for not-the-most-recent Mac OS versions:


With the Automator app,

  1. Create a new Quick Action
  2. Takes no input in application Numbers
  3. Drag the Run AppleScript action from the list of actions on the left
  4. Delete the default text and paste in the script
  5. Save it with a name like "Goto Cell"


The "quick action" will appear in the Numbers->Service menu


With System Preferences,

  1. Navigate to Keyboard->Shortcuts->App Shortcuts
  2. Create a keyboard shortcut for your service/quick action. You must type the menu title exactly as it appears in the menu.


To use it,

  1. Put text in a cell like it says in the comments at the beginning of the script.
  2. Select the cell
  3. Use your keyboard shortcut

Oct 21, 2024 5:36 PM in response to Ponderosa

In Numbers, unlike in Excel, one rarely works with one big grid of cells in a table that can be hard to navigate.


In Numbers, unlike in Excel, you can easily and naturally split your work into different tables on the same sheet (if you haven't done so already have a look at the templates at File > New in the menu for examples).


Moving from one table to another is easy. Just select from the dropdown that appears when you hover and click the v next to the sheet name in the "tab" for that sheet at the top.


SG

Hyperlink in one cell scrolls/moves your view to another cell in the same sheet

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