title: Count the number of comments on a particular worksheet
body: <p>My code below gives me the number of notes on a sheet, not comments. I need the number of comments on a sheet. The number of comments per sheet is shown on the worksheet tab, but I have many tabs and I want to get this number programmatically.</p>
  
  <p>There are methods for notes in the class <a href="https://developers.google.com/apps-script/reference/spreadsheet/range" rel="nofollow">range</a> but there are no non-deprecated methods that deal with comments.
  People have made this an <a href="https://code.google.com/p/google-apps-script-issues/issues/detail?id=2566" rel="nofollow">issue</a>.</p>
  
  <pre><code>function getCommentNumber() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = ss.getSheets()[0];
    var range = sheet.getRange("A1:A12");
    var results = range.getNotes();
    Logger.log(results);
    var commentNumber = 0;
    for ( i in results) {
      if (results[i] != ""){
      commentNumber += 1;
       }
    }
    Logger.log(commentNumber);
   }
  </code></pre>
  
  <p>Is there a way to count up the number of comments on a particular worksheet?</p>
  
  <p>Could comments be converted to notes then converted back?</p>
  
  <p>Is there a way to programmatically get the comment number from the data that is shown on the worksheet tab?</p>