A
A
AliMitr2020-09-24 17:17:24
Google Sheets
AliMitr, 2020-09-24 17:17:24

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.
5f6cab2aefd71932859750.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Grigory Boev, 2020-09-25
@ProgrammerForever

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);
  };

This is one of many options.
Demo table

D
Dimonchik, 2020-09-25
@dimonchik2013

https://support.google.com/docs/thread/24223625?hl=en

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question