Note that there are some explanatory texts on larger screens.

plurals
  1. POInsert "LastUpdate Date" when some specific columns are modified (Help in the script)
    primarykey
    data
    text
    <h1>Situation:</h1> <p>I have a spreadsheet with 10 sheets and 15 users logging in and modifying it.</p> <h1>Script Function:</h1> <p>When someone modify any row in any column, this script will update the lastcolumn with DateTime and insert a comment with the user who made that modification.</p> <h1>Problem:</h1> <p>(1) Performance Issue: This script run when the user modify any Column. This cause maybe when I have more > 3 user logged the spreadsheet turn slowly to save. <br>(2) This script should be run only when some specific's columns are modify. For ej.: If the activeuser modify the column A,B,C;D,E &amp; I the script update the lastcolumn J with the Date&Time; but if the activeuser modify the column F,G,H the script should be not run.</p> <h1>Test Case:</h1> <p>(1) This script is running OnEdit very well but is updating the lastcoulmn when someone modify anyrow in any column.</p> <p>I will appreciate if anyone can help me to modify this script for only run when specific columns are modified.</p> <h1>Script:</h1> <pre><code> function onEdit(event) { var ss = SpreadsheetApp.getActiveSpreadsheet(); //Script Last Update Timming var actSht = event.source.getActiveSheet(); var actRng = event.source.getActiveRange(); var index = actRng.getRowIndex(); var dateCol = actSht.getLastColumn(); var lastCell = actSht.getRange(index,dateCol); var date = Utilities.formatDate(new Date(), "GMT-3", "dd/MM/yyyy HH:mm"); // Note: Insert the Date when someone update the row in the last coulmn lastCell.setValue(date); // Nota: Insert a comment in the lastCell with the user who modify that row lastCell.setComment(Session.getEffectiveUser()); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload