I Want To Use =GETLASTROW(A1:A10)
instead of =GETLASTROW("A1:A10")
i want to get the last row number of a specific range that have values on it ...
Here Is My Custom Function Can You Update This ? 👇👇👇
/**
* Get the last row counts with the blank cells included for a specific range selected.
*
* @param {A1:A10} range -->Enter the column number to count on.
*
* @customfunction
*/
function GETLASTROW(range) {
var ss = SpreadsheetApp.getActive().getActiveSheet();
var rg = ss.getRange(range).getValues();
var lrindex;
for(var i = rg.length-1;i>=0;i--){
lrindex = i;
if(!rg[i].every(function(c){ return c == ""; })){
break;
}
}
return lrindex + 1;
}
if you made this then please reply me my updating my code ...
Welcome to SO, You can't use it like this GETLASTROW(A1:A10) here A1:A10 Is not a type that JS knows of you need to use one the JavaScript types such as String, Array, Object, I think objects is the closest thing for your example you can call the function like this GETLASTROW({A1:"A10"}).
Then you can use it like this
GETLASTROW({A1:"A10"})
function GETLASTROW(rangeObject){
var range = rangeObject["A1"] // the value of this will be A10
}