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

Run Google Sheets script on multiple sheets

$
0
0

I have a Google Sheets script that's designed to input timestamps whenever there is an edit, but I need it to run on multiple sheets (West, East AND North) on the same drive... How can I make that work?

See the code below:

function onEdit(e) {  var ss = SpreadsheetApp.getActiveSheet();  var r = ss.getActiveCell();  //1.Change 'Sheet1' to be matching your sheet name  if (r.getColumn() < 9 && ss.getName()=='WEST') { // 2. If Edit is done in any column before Column (L)  And sheet name is WEST then:    var celladdress ='L'+ r.getRowIndex()     ss.getRange(celladdress).setValue(new Date()).setNumberFormat("MM/dd/yyyy hh:mm");  }};

Viewing all articles
Browse latest Browse all 9713

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>