title: How to convert range to string in Google Spreadsheet?
body: <p>I have a script in Google Spreadsheet that counts how many cells of specified colors are in the range (for example 10 cells in a range and 3 of them have a red font).</p>
  
  <pre><code>function countTextColor(inputRangeStr, inputColorStr) {
    var inputRange = SpreadsheetApp.getActive()
      .getActiveSheet()
      .getRange(inputRangeStr);
      . . . 
      . . . 
  }
  </code></pre>
  
  <p>If I call the function where the range is as a string, then there's no problem:</p>
  
  <pre><code>=COUNTTEXTCOLOR("A1:F1", "#ff0000")
  </code></pre>
  
  <p>But I need to use the range as a real reference where it dynamically points to the specified cells. When calling it like this...</p>
  
  <pre><code>=COUNTTEXTCOLOR(A1:F1, "#ff0000")
  </code></pre>
  
  <p>... it returns Exception:</p>
  
  <pre><code>Range not found (line 9).
  </code></pre>
  
  <p>I understand that the reference needs to be converted to a string format but how to do that? </p>