title: Google-apps-script function CHAR() and CODE()
body: <p>I am beginner in script programming and I would like to use the equivalent function <strong>CHAR()</strong> and <strong>CODE()</strong> in order to increment Alphabet characters according to an IF condition.</p>
  
  <p>Example of formula I use in Google Sheets in the cells ("D11")
  "=IF(C11=C10;CHAR(CODE(A10)+1);"A")" .</p>
  
  <p>I have written the following script:</p>
  
  <pre><code>function onFormSubmit(e) {
  
  //Déclaration des variables
  var SheetResponse = SpreadsheetApp.getActiveSheet();
  var DerniereLigne =  SpreadsheetApp.getActiveSheet().getLastRow();
  var DateToday = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), 'ddMMYY');
  
  //Intégration dsu suffixe alphabétqiue pour l'ID
  if (SheetResponse.getRange(DerniereLigne,2).getValue() &lt;&gt; SheetResponse.getRange(DerniereLigne-1,2).getValue()) {
            var Alpha = SheetResponse.getRange(DerniereLigne,15).setValue("A");
          }
       else {
            Alpha = SheetResponse.getRange(DerniereLigne,15).setValue(CHAR(CODE(Alpha)+1);
          }
  
  //Création de l'ID dans la derniére ligne et colonne "N"
  SheetResponse.getRange(DerniereLigne,14).setValue(DateToday + Alpha);
  
  }
  </code></pre>
  
  <p>Please, Could someone help me.
  Thank you in advance.</p>