I’m stuck with a Google Sheets problem. I know how to make links between worksheets using cell references like A1 or B2. But I’m trying to use named ranges instead.
Here’s what I mean:
I can link to cell K1 easily
I renamed K1 to ‘TestCell’
Now the link doesn’t work with ‘TestCell’
I thought using named ranges would make my links clearer, but it’s not working as expected. The link only works if I use the original cell reference.
Is there a way to make links work with named ranges? Or am I missing something obvious?
Any help would be great. I’m new to using named ranges and I’m not sure if I’m doing something wrong or if this just isn’t possible in Google Sheets.
// Example of what I'm trying to do
let oldLink = 'worksheet2!K1';
let newLink = 'worksheet2!TestCell';
function goToCell(link) {
// This works
sheets.navigateTo(oldLink);
// This doesn't work
sheets.navigateTo(newLink);
}
I’ve wrestled with this problem too. Named ranges are great for formulas, but they’re a pain for navigation. Here’s a trick I stumbled upon: use the CELL function to get the address of your named range, then build your hyperlink with that. Something like:
It’s not perfect, but it gets the job done. You’ll need to update the sheet_id manually, though. I usually keep a hidden reference cell with the sheet ID to make updates easier.
One caveat: this method breaks if you move the named range to a different sheet. But for most use cases, it’s been reliable enough for me. Hope this helps!
I’ve encountered this issue before. Unfortunately, Google Sheets doesn’t natively support hyperlinks to named ranges. However, there’s a workaround using the INDIRECT function as mentioned. Another approach is to use Google Apps Script to create custom functions that can navigate to named ranges. This requires some coding knowledge but offers more flexibility. For example:
function goToNamedRange(rangeName) {
var range = SpreadsheetApp.getActiveSpreadsheet().getRangeByName(rangeName);
SpreadsheetApp.getActiveSpreadsheet().setActiveRange(range);
}
You can then call this function from a custom menu or button in your sheet. It’s not as seamless as direct linking, but it achieves the desired result of navigating to named ranges programmatically.
hey emcarter, i feel ya. named ranges can be tricky. sadly, google sheets doesn’t support direct linking to named ranges like that. but here’s a workaround: use the INDIRECT function. try =HYPERLINK(“#gid=sheetid&range=”&INDIRECT(“TestCell”)). it’s not perfect, but might help. good luck!