Good evening
I need to create a google sheets with possible inputs from 3 persons.
The sheet should contain the following columns :
1. Day
2. Date
3. Type
4. Participant/s
5. Topic
6. Comment
I would like to have an automatic addition of a row above the date, once entered.
I also would appreciate each odd row in a specific colour and even row in other.
Could you please help in this regard please ?
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/2674937d-912b-49c7-8fee-4c500b9a98d3n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/20f1fc7b-d46f-400c-a925-018877f18184n%40googlegroups.com.
Hi Nerio
Many thanks for your help
Unfortunately, it is adding a row UNDER and not ABOVE
And it is not keeping the format nor the formulas
I managed with this :
function onEdit(e) { var sheet = e.range.getSheet(); var column = e.range.getColumn(); var row = e.range.getRow(); if (column === 5 && e.value) { // If a value is entered in column 5 (Date) sheet.insertRowBefore(row); // Insert a new row before the edited cell var lastRow = sheet.getLastRow(); var range = sheet.getRange(row - 1, 1, 1, sheet.getLastColumn() - 1); // Include an extra column on the right var targetRange = sheet.getRange(lastRow, 1, 1, sheet.getLastColumn() + 1); // Include an extra column on the right var formulas = range.getFormulas(); // Get the formulas from the previous row targetRange.setFormulas(formulas); // Set the formulas in the new row }}
Adding a row BEFORE, but it is not copying the formulas
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/4c09a0ab-2ba2-487d-baf4-cf9548b4d85cn%40googlegroups.com.