Я новичок в javascript и редакторе скриптов. Я продвинулся довольно далеко, объясняя себе логику и шаг за шагом разбирая вещи. Но есть еще одна последняя часть головоломки, которую я никак не могу решить. Я хочу, чтобы скрипт перешел к первому пустому столбцу строки 16 и дал мне строку + столбец этой конкретной ячейки. Весь код работает, однако, что происходит, когда он доходит до шага 5 скрипта, так это то, что он помещает "это сработало" в последний пустой столбец строки, а не в первый .
function refreshCell(){
var app = SpreadsheetApp.openById("14FgHQieAOCko3pwzLSUnO5Ky5EuLN88r5Y4LnuMKREI");
var sheetName = app.getSheetByName("FinancialGoals");
var cellContainingFormula = sheetName.getRange("J14");
/* 1. Clear cell containing formula */
cellContainingFormula.clear();
/* 2. auto-run functon refreshCell on the first of the month: edit > project triggers > add new trigger */
/* 3. Add new formula to cell */
cellContainingFormula.setValue('=10248-A16');
/* 4. Add formatting to cell: set background color, textcolor green, text bold, center text */
cellContainingFormula.setBackground('#B7B7B7').setFontColor('#38761d').setHorizontalAlignment('center');
/* 5. Navigate to the first empty column of row */
var lastColumn = sheetName.getLastColumn();
var activeCell = sheetName.getRange(16, lastColumn).activate();
activeCell.setValue("it worked")
}
/* 5. Navigate to the first empty column of row */
иI would like for script to go to the first empty column of row 16
, а такжеis that it is placing "it worked" in the last empty column of the row, instead of the first.
не совсем понимаете, что имеете в виду. Как насчет картинки. - person Cooper   schedule 11.06.2020