Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9685

Google Sheets onEdit uppercase script

$
0
0

I'm collecting one-letter responses from users in a Google Sheet and would like their responses to be made uppercase as they are input, but only within the cells D5-J[infinity]. I found a few responses on how to do this and Frankensteined the following code in Script Editor, but it's not firing. What's wrong?

function onEdit(e) {
  var column = e.range.getColumn();
  var row = e.range.getRow();

  if ( col >=  4 && col <= 10 ) {
    if ( row >= 5 ) {
      if (typeof e.value != 'object') {
        e.range.setValue(e.value.toUpperCase());
      }
    }
  }
}

Viewing all articles
Browse latest Browse all 9685

Trending Articles