var rows = 13;
var columns = 1;
var ss = SpreadsheetApp.getActiveSpreadsheet();
function addRow() {
var sheet = ss.getSheets()[0];
var column_index = columns; // your column to resolve
var cell = sheet.getRange(rows, columns, 1, 1);
// Sets borders on the top and bottom, but leaves the left and right unchanged
// Also sets the color to "red", and the border to "DASHED".
cell.setBorder(true, true, true, true, true, true, "black", SpreadsheetApp.BorderStyle.SOLID);
rows = rows +2
}
This is the script for a button. When the button is clicked, I want to create a border around the cell, 2 rows after the current row. However, when the button is clicked, the row variable remains 13, even though I have the rows - rows+2 at the end of each click.