Answer the question
In order to leave comments, you need to log in
How to create a cell for entering sequential data in a long table?
My google spreadsheet has a long list of cells. Each time you have to scroll to the bottom to write down the data. How to create a cell in the A1 input field so that when you press "ENTER" the value goes down to the cell below and shifts the lower cells under itself.
Let me explain in more detail using an example table. Where "Input field" we enter some value and it goes down to the red cell, and the green ones go down.
Answer the question
In order to leave comments, you need to log in
You just need to monitor the onEdit trigger and insert a line if there was a change in A1
function onEdit(event) {
//Возникает при изменении ячейки
const ss = event.source.getActiveSheet();//Текущий лист
const address = event.range.getA1Notation().toUpperCase();//Адрес ячейки
if (address!=="A1") return;//Указываем адрес "активной" ячейки
if (["Лист1","Лист2"].indexOf(ss.getName())==-1) return; //Указываем на каких листах должен работать скрипт
const beforePosition = event.range.getRow();
ss.insertRowBefore(beforePosition);
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question