title: How do I change a set range in a google sheets script so that it can be selected in the cell?
body: <p>First off, I am not a coder at all, just a teacher who's handy at googling things to make life easier. In my attendance book, I bold the times a student comes in tardy (they get a 1 if present and a 0 if absent in order to calculate attendance rate).</p>
  
  <p>I found an awesome script that allows me to count the number of bold items in a range. However, the range is set and I can't specify a new range within google sheets for each student as is necessary.</p>
  
  <p>I tried changing it to "function countColoredCells(countRange)" but it doesn't work as I assume there is something else I have to do within the rest of the script. </p>
  
  <p>I literally have little to no coding knowledge and would <em>really</em> appreciate any help to solve this!</p>
  
  <pre><code>    function countboldcells() {
        var book = SpreadsheetApp.getActiveSpreadsheet();
        var sheet = book.getActiveSheet();
        var range_input = sheet.getRange("C3:S3"); 
        var range_output = sheet.getRange("N3");
        var cell_styles = range_input.getFontWeights(); 
        var count = 0;
  
        for(var r = 0; r &lt; cell_styles.length; r++) {
          for(var c = 0; c &lt; cell_styles[0].length; c++) { 
            if(cell_styles[r][c] === "bold") { 
             count = count + 1; 
              }
            }
          }
          range_output.setValue(count); 
        }
  </code></pre>