1

How to adapt this function to exclude a specific cell or how to apply just to one cell?

function onEdit(e) {
  if (typeof e.value != 'object') {
    e.range.setValue(e.value.toUpperCase());
  }
}
0

Convert a text of a specific cell ... to UPPERCASE

  • try like this which should upper Sheet1!A2 cell:

function onEdit(e) {
    var sheet, sheetName, colToCapitalize;
    sheet = e.source.getActiveSheet();
    colToCapitalize = 1;
    sheetName = 'Sheet1';
    if (sheet.getName() !== sheetName || e.range.rowStart = 2 || e.range.columnStart !== colToCapitalize || typeof e.value == 'object') return;
    e.range.setValue(e.value.toUpperCase())
}

  • user0, thanks for your help. But, and if I only want to exclude a specific cell, in the original script? – Leandro Amorim May 22 at 19:24
  • I got this message when saving: Invalid assignment left-hand side. (linha 1, arquivo "macros")Dispensar – Leandro Amorim May 22 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.