Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
How Can I use a custom function's range without Quotation?

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 ...

about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

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
}
about 4 years ago ยท Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!