Google Sheets Apps Script, won't register cell value

I have a google sheet that uses an app script button to send the values from that sheet to another sheet. If someone forgets to press enter after filling in their information, it will not send the last cell value.

So if the cell previously had the value of 3, then we change it to 4, but don’t press enter, it will send the value of 3.

The solution, I think, is at the beginning of the function for it to submit somehow, or press enter, or select another cell, anything that works. But I can’t figure out how to do that so far.

I’ve tried various things but I can’t find the right apps script function.

So far without pressing enter, or clicking on another cell, I am unable to access that cell value. Changing the active selection doesn’t work.

const sh = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("L1");

// change the active selection to another cell, but it just moves the 4 to the new cell

>Solution :

In Google Sheets, it’s not possible to force the cell edit submission (a.k. pressing enter) on behalf the active user. If training your spreadsheet users doesn’t look a good solution, then you should consider another way for data entry, i.e. make a form in dialog/sidebar so you can use client side HTML/CSS/JavaScript to control your form.

Leave a Reply