eliminate row

20 views
Skip to first unread message

Fatty Calçados

unread,
Sep 6, 2021, 10:19:35 AMSep 6
to Google Apps Script Community
Hello
I´m trying to create macro that eliminate a row in case the activecell (column E); is empty or if equals a determinate valeu but it´s not working.
I also want to create a loop to repeat this command while the cells atcolumn B are fullfilled.

Can someone help me ?




Peter C

unread,
Sep 8, 2021, 7:02:01 AMSep 8
to Google Apps Script Community
Hello,

Below is a sample code to get you started.

Excellent day

var SRep = SpreadsheetApp.getActiveSpreadsheet();
var Onglet = SRep.getSheetByName('NameSheet');
var ActiveRow = Onglet.getActiveCell().getRow();

if (ActiveRow <= 2) { Browser.msgBox("You cannot delete lines 1 and 2 !"); return; }

if (Browser.msgBox("Hello, Do you want to delete the record, line : "+ActiveRow+" ?"+
"\\n\\nIf you click YES the recording will be deleted."
,Browser.Buttons.YES_NO) == 'yes') {

OngletReponse1.deleteRow(ActiveRow);

console.log("Deletion of the recording : "+ActiveRow);
Reply all
Reply to author
Forward
0 new messages