title: Google Apps Script - How to get A1 Notation of a range when you don't know the length
body: <p>I'm sure there is a simple way to do this but I'm spinning wheels trying to figure it out. I have several columns, each of different lengths. I would like to get the A1 notation for each of them, minus a header.
  I get the index number of the column and then I want to get a range that includes all values under the header. What is the best way to go about this? Probably a trivial solution but thanks for help.</p>
  
  <pre><code>function get_range(header) {
      var data = s.getDataRange().getValues();
      var row = data[0];
      for( i in row){
          if (row[i] == header) {
              var colinx = parseInt(i)+1;
              var range = s.getRange(2,colinx,);
              var notation = range.getA1Notation();
  Logger.log(notation);
          }
      }
  }
  </code></pre>