Google Sheet Script to convert values to Lowercase

760 views Asked by At

New to scripting, trying to use the OnEdit() to force lowercase on values in column E

started with a few iteration of the following with no succes...

    function onEdit(e) {
      var range = e.range;
      var value = range.getValue();
      if (range.getColumn() = 5 ) {
            e.range.setValue(e.value.toLowerCase());
          } else {
            return;
          }
      }

Any easy tweak you can think of to force lowercase on edits in cloumn E?

Thank you, JF

1

There are 1 answers

0
Cooper On
function onEdit(e) {
  if (e.range.columnStart == 5) {
    e.range.setValue(e.value.toLowerCase());
  }
}

Generally scripts limit there activity to a specific set of pages and rows. I suppose you are aware that this trigger will be running for all of your tab/sheets.