'Scripts for Google sheets for static timestamp and script to separate building numbers

so i've been trying the last few days to find a way to make a static timestamp for a work sheet, however the ones using iterative calculation doesn't quite work either because they update with every change on the sheet or when you refresh the whole sheet, and the scripts i can't really find an updated one with the current resources google sheet offers ( most videos etc had a different script writer in them )

The idea would be to have a dropdown menu and when it has any option besides "" get a static timestamp

The other part would be to separate building numbers from streets, for ex:

Apple street 1 Apple street 2 ... etc, the database from work is kinda messy so the 1 usually get's mixed with 10's and stuff like that, this way it could be organized and see more clearly instead of having to build a puzzle

Thanks for any input in advance ^^



Solution 1:[1]

here's example of such timestamp sheet:

function onEdit(e) {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() =="Sheet1" ) {                   //1st sheet
var r = s.getActiveCell();
if( r.getColumn() == 1 ) {                       //monitor column A
  var nextCell = r.offset(0, 1);                 //print timestamp in column B
  var newDate = Utilities.formatDate(new Date(), 
  "GMT+8", "MM/dd/yyyy HH:mm:ss");               //format of the timestamp
  nextCell.setValue(newDate);
}}
if( s.getName() =="Sheet2" ) {                   //2nd sheet
var r = s.getActiveCell();
if( r.getColumn() == 1 ) {                       //monitor column A
  var nextCell = r.offset(0, 1);                 //print timestamp in column B
  var newDate1 = Utilities.formatDate(new Date(), 
  "GMT+8", "MM/dd/yyyy HH:mm:ss");               //format of the timestamp
  nextCell.setValue(newDate1);
}}}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 player0