I have a sheet with 2 columns (A and B) that have values that are derived from another sheet and are linked. I would like to date stamp the sheet based on when the columns were last edited. In other words, when the source sheet changes a data point in A or B or both, a date stamp is placed in C4 as an example. The next time it changes, be it a day or a week, the date changes in C4 to the date it changes. Might as well be date and time since we are at it.
相关问题
- How can I force all files in a folder to be owned
- Google Apps Script: testing doPost() with cURL
- Google Apps Script to turn in, grade, and return a
- mySQL alter table on update, current timestamp
- How to convert from Timestamp to Mongo ObjectID
相关文章
- How to allow access for importrange function via a
- Google app script trigger not working
- Set Date/Time to 00:00:00
- indexOf returning -1 despite object being in the a
- Using MIN() inside ARRAYFORMULA()
- How can my Google Apps Script be run by others the
- Google Spreadsheet COUNTIF formula equivalent with
- In Google Sheets how to reference infinite rows in
Given the separation layer between your data and the column you want timestamped, you're going to probably need something beyond a "simple"
on edit
trigger function. Theon edit
trigger functions are great when the value changes are due to user actions, but otherwise they are limited (script executions will not activate them).One possible solution is to use a simple on edit trigger to stamp when your source sheet inputs are altered, and on your report sheet, reference the relevant maximum value of the corresponding date cells for each of the inputs to the given report.
Another possible solution is to implement a comparison method that is activated by whatever system changes data on the source sheets, and compares stored values for A & B with current values for A & B, and if one changes, then updates the timestamp and the backup of the report.
An example of this comparison & backup function:
I leave writing the code which calls
stampAndBackup
to the reader, since it is heavily implementation-dependent.