title: How to pass a range into a custom function in Google Spreadsheets?
body: <p>I am trying to compare two google sheets (for duplicate values) over a predefined range..</p>
  
  <p>I am aware that google lets you compare sheets via tools, but i need a more customized comparison hence the function.</p>
  
  <p>I want to create a function which takes in a range... something like:</p>
  
  <pre><code>    function myFunction(range) {
      var firstColumn = range.getColumn();
      // loop over the range
      }
  </code></pre>
  
  <p>The problem is that when I try doing this, the parameter seems like it is only passing the values to the function. Thus, I cannot use any of the Range methods such as getColumn(). When I attempt to do so, it gives the following error:</p>
  
  <pre><code>    error: TypeError: Cannot find function getColumn in object 1,2,3.
  </code></pre>
  
  <p>How can I send an actual range rather than just the values to one of my custom functions?</p>
  
  <p>Note- Range in my case is the entire sheet (both of them that need to be compared).</p>
  
  <p>Thanks!</p>