Answer the question
In order to leave comments, you need to log in
How to insert cells from another page and edit them in Google Sheets?
I have several pages in the book. I need the first column from the first page to be visible on each page with formatting. You also need to be able to edit this column from any page. How can this be implemented?
Answer the question
In order to leave comments, you need to log in
Use the onEdit(event) function to track changes. Each time you change the first column - copy the entire column to all other sheets. Fires only on value changes, not on formatting changes.
function onEdit(event){
ss=SpreadsheetApp.getActiveSpreadsheet();//Текущая книга
if (event.source.getActiveRange().getColumn()===1){//Если столбец №1
ss.getSheets().forEach(function(sheet){//Перебираем все листы
if (event.source.getActiveSheet().getName()!=sheet.getName()){//Если это другой лист
event.source.getActiveSheet().getRange('A:A').copyTo(sheet.getRange('A:A'), SpreadsheetApp.CopyPasteType.PASTE_NORMAL, false);//Копируем 1й столбец
};
});
};
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question