title: Google Scripts: cannot convert range to (class) error
body: <p>I'm getting this error:
  "Cannot convert range to (class) on this line:</p>
  
  <pre><code>var cellFrom = ss.getRange(rowFrom, i).getCell(1,1);
  </code></pre>
  
  <p>This is the function:</p>
  
  <pre><code>function copyValidations(sheetName, rowFrom, rowTo, column, numColumns) {
   /* Copy validations of all cells in rowFrom to cells in rowTo, starting at column.\*/
  
    var sh = SpreadsheetApp.getActiveSpreadsheet();
    var ss = sh.getSheetByName(sheetName);
  
    for (var i = column;i&lt;= column + numColumns;i++) {
      var cellFrom = ss.getRange(rowFrom, i).getCell(1,1);
      var cellTo = ss.getRange(rowTo, i).getCell(1,1);
      copyCellDataValidation(cellFrom, cellTo); 
    }
  }
  </code></pre>
  
  <p>I need to pass ranges of single cells to copyCellDataValidation:</p>
  
  <pre><code>function copyCellDataValidation(cellFrom, cellTo) {
   /* Copies the data validation rules and data from a single cell to another cell
  */
  
    var rule = cellFrom.getDataValidation();
    if (rule != null) {
     var criteria = rule.getCriteriaType();
     var args = rule.getCriteriaValues();
     cellTo.setDataValidation(rule.copy().withCriteria(criteria, args).build());
    } else {
     //Logger.log('copyCellDataValidation: The cell does not have a data-validation rule.')
    }
  }
  </code></pre>
  
  <p>I only found suggestions to fix this error when setValues() was involved, but nothing to help me here.
  Thank you for your help!</p>