Create script where if a column is not empty type " message " in another column

Asked

Viewed 402 times

-1

If column 6 is not Empty, the script stamps "make loans" in column 13. I tried to accomplish something like script below, because it could be done by a formula, but it cannot have formulas in this column Nº 13.

How could I adjust a script for this event ?

function onEdit() {
   var ActiveSheet= SpreadsheetApp.getActiveSheet();
   var capture = ActiveSheet.getActiveCell();
   if(capture.getColumn() == 6  && ActiveSheet.getName() == 'PLANILHA DE ATIVIDADES')  {
     var add = capture.offset(0, +13);
     var write = "realizar empréstimos;
     }
}

1 answer

0

Checking the onEdit function implemented a Google Apps Script that worked well for the solution I was trying to accomplish. Follow the template of the script below. The explanation of the code is: If the cell in column 9 is different from empty, then it will add to 4 columns the front of column 9, the text "make loans"

Function onEdit() { var Activesheet= Spreadsheetapp.getActiveSheet(); var capture = Activesheet.getActiveCell(); if(capture.getColumn() == 9 && Activesheet.getName() == 'ACTIVITY SHEET') { var add = capture.offset(0, 4); var write = "make loans ."; add.setValue(write); }; }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.