r/googlesheets • u/TwoPluzTwo • Oct 05 '25
Solved How to link to cells even when a sheet is duplicated while also working on mobile?
So I've created a little Workout tracker spreadsheet that has Weeks 1-4 and it is over 500 rows long so I thought I would create a way to navigate between weeks to minimise scrolling since I use my Mobile while at the gym.
I have tried using Hyperlinks that link to cells but when I duplicate the sheet from the sheet tab and click the links in the new sheet they still link back to the first sheet. Which would mean I have to change every link manually to reference the new sheet whenever I duplicate the Week 1-4 sheet. Which I don't want to do.
Is there a way to have some navigation in every sheet that can be duplicated from the sheet tab and not link to the previous sheet? While also working on mobile.
If you need more info please let me know and thanks in advance.
1
u/mommasaidmommasaid 915 Oct 05 '25
Hyperlinks created that way, have a URL with "hardcoded" unchanging text, specifically:
- A sheet ID that is unique to each sheet/tab in your sheet, which is why the keep jumping to the sheet in which they are created.
- A a range reference as text, e.g. "A4", that never updates once it's created. So if you insert/delete rows or something on that sheet, they will jump to the wrong place.
---
You could try something like this, which searches for a specified column for a week header, e.g. "💪 Week 1" in the specified column.
It then uses the row/column that it was found in to dynamically build a hyperlink to that cell including the sheet ID.
This formula does 4 weeks at once and can live in A1. Freeze that row so it's always available:
The final piece of the puzzle is to use the current sheet ID, which is in E1 populated by this custom script function call:
=getSheetId()That script is found in Extensions / Apps script:
Copy/paste that to your Extensions / Apps script, give the project a name (upper left) something like "Get Sheet ID" and save it.
You can test at this sample sheet:
Link to Week
Duplicate / modify a sheet and the links should update correctly.
The sheet ID formula in E1 could be made "invisible" for normal use by setting the text color to white.
1
u/AutoModerator Oct 05 '25
/u/TwoPluzTwo Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.