title: Iterate through cells in Google Sheets; change to Hyperlink based on condition
body: <p>So I've been playing around with iterating through cells. I want to go through an entire sheet, and if a cell contains certain text, change the cell to a hyperlink formula.
  I know the hyperlink formula works; I've run the script with <code>range.setNote()</code> and <code>range.clearNote()</code> to check that it is going through each cell, but it's not adjusting the cells based on their text.</p>
  
  <pre><code> function Hyperlink() {
   var ss=SpreadsheetApp.getActiveSpreadsheet();
   var sheet = ss.getSheetByName("Sheet 1")
   var selection=sheet.getDataRange();
   var columns=selection.getNumColumns();
   var rows=selection.getNumRows();
    for (var column=1; column &lt; columns; column++) {
     for (var row=1; row &lt; rows; row++) { 
      var cell=selection.getCell(row,column).getFormula();
      var range = selection.getCell(row, column);
      if (cell.indexOf("ABC") &gt;= 0) {
      //This checks if the cell contains "ABC"
        range.setFormula('=HYPERLINK("//google.com/search?q=' + cell    + '", "' + cell + '")'); //This adds the hyperlink, using the Google Search functionality
       }
     }
   }
  }
  </code></pre>
  
  <p>I've tried <code>getValue()</code> and <code>getFormula()</code>, I'm not sure where the issue lies. The script doesn't throw an error, but nothing happens when I run it.</p>
  
  <p>Any thoughts?</p>
  
  <p>Edit: I have a separate script to perform this auto-hyperlink with new edits using <code>onEdit(e)</code>; I just want to perform a retroactive adjustment of all existing cells with text "ABC" in this example.</p>