I'm struggling to find a solution to return the current cell a function is being written in.
For instance, when defining a range I want to make the first and second parameters (integer row and integer column) be dynamic.
If the cell I'm currently calling the function in is cell H1, then the integer row has to be 1 and the integer column has to be 8. Moving the function would also move the row and column.
sheet.getActiveCell()
and sheet.getCurrentCell()
is just returning null.
In the first image above: Lines tagged as 1 are where the parameters need to be dynamic. Box number 2 is where I am trying to get the current cells value.
function dynamicRange() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
var completePercentRangeStart = sheet.getActiveCell().getValues();
var range = sheet.getRange(1, 8, 3, 1);
return completePercentRangeStart;
}