-1

On my Google sheet I created an Apps Script to time stamp the sheet at B1 any time that it is edited:

```
/** @OnlyCurrentDoc */
function onEdit(e){
const sh = e.source.getActiveSheet();
sh.getRange ('B1')
.setValue (new Date())
.setNumberFormat ('yyyy-MMM-dd HH:MM');
}
```

I would like to use this Apps Script for other Google Sheets of mine without having to copy and paste the code to each sheet.

I have looked at

How can I share my app script, between google spreadsheets? and

How to share or distribute google apps script with other users? and

https://www.youtube.com/watch?v=voft0qZfkvw

but have not succeeded after a couple of hours of trying.

Please help if you can. Thanks.

  • About `I would like to use this Apps Script for other Google Sheets of mine without having to copy and paste the code to each sheet.`, in your situation, how many Spreadsheets do you want to use? – Tanaike Aug 12 '23 at 00:41
  • `but have not succeeded after a couple of hours of trying.` Would you please clarify: what did you try and what was the result? – Tedinoz Aug 12 '23 at 01:13
  • https://stackoverflow.com/questions/28413397/sharing-a-google-spreadsheet-containing-a-script-with-a-workgroup-so-they-can-us – Cooper Aug 12 '23 at 16:18
  • https://stackoverflow.com/questions/26630318/how-can-i-share-my-app-script-between-google-spreadsheets – Cooper Aug 12 '23 at 16:19
  • I would like to have this Apps Script available for nearly all of my Google sheets. I followed the instructions in the above links but either did not see the same options that they spoke of, or I tried them and I did not get the result of being able to share one Apps Script across multiple Google sheets. If you have had success with one of these or another method, please let me know. I will try again. – Fred Hickernell Aug 24 '23 at 18:02
  • Regarding Cooper's second link, I tried but got stuck following the instructions for adding it to the store. Perhaps I need to try again. – Fred Hickernell Aug 24 '23 at 18:04

0 Answers0