Answer the question
In order to leave comments, you need to log in
How to make a link to a cell in the form of a script?
Hello, I have a very long table, and with the help of buttons I want to make my own menu, which I will attach on the first line. As I understand it, you can attach a script to each button. How can, for example, make a script that will lead, for example, to cell A956, and so on. One button leads to one cell, the second button to another. I tried to make just links to cells, it doesn’t look very good, because when you hover, a link appears that you need to click on. And I would like just a button, like on the sites.
If anyone knows, I will be glad for a detailed answer, since I do not really understand this.
Answer the question
In order to leave comments, you need to log in
Add the following code to your Table project
const goToWrapper_ = (address) => {
const range = getRangeByRefString_(SpreadsheetApp.getActiveSheet(), address);
range.getSheet().getRange('A1').activate();
range.activate();
}
function getRangeByRefString_(sheet, refString) {
return refString.indexOf('!') === -1 ?
sheet.getRange(refString) :
sheet.getParent().getRange(refString);
}
function goTo555() {
goToWrapper_('A555');
}
function goToSheet5A555() {
goToWrapper_('Sheet5!A555');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question