0

I am creating a simple inventory management system using google sheets and am trying to automate using some of the scripting tools available. In this I am trying to create links to other cells so that when you enter an inventory update you can click the link to take your cursor to the updated item. This is the code for the link

var link = "#grid=" + s.getIndex() + "&range=" + s.getRange('A' + (i + 16).toString()).getA1Notation(); 
var formula = '=HYPERLINK("' + link + '", "Go to")'; 
console.log(formula); s.getRange('E3').setFormula(formula).setBackground(null);

This creates a hyperlink with the generated link but clicking it throws the error given in the title. Later in the code I use a clear content on A3. Would it be possible that that interferes with the entire row?

So far my attempts have been minimal because I am struggling to find links even to the error. Any insight is greatly appreciated. Thank you.

  • I have to apologize for my poor English skill. Unfortunately, I cannot understand your question. Can I ask you about the detail of your expected result? – Tanaike Jul 09 '23 at 00:40
  • Does this answer your question? [How to create hyperlink to range in Google Sheets App Script?](https://stackoverflow.com/questions/46301490/how-to-create-hyperlink-to-range-in-google-sheets-app-script) – Tedinoz Jul 09 '23 at 02:32
  • There are four answers on the referenced answer. I found the answer by @Brian [ref](https://stackoverflow.com/a/46304000/1330560) to be very simple, and easily adapted to your script. – Tedinoz Jul 09 '23 at 02:34

0 Answers0