Skip to content

Instantly share code, notes, and snippets.

@tomoyamkung
Created July 19, 2012 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomoyamkung/3140916 to your computer and use it in GitHub Desktop.
Save tomoyamkung/3140916 to your computer and use it in GitHub Desktop.
Google Docs の SpreadSheet にアクティブなセルに現在時刻をセットするボタンを追加するスクリプト
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [
{name: "now", functionName: "writeNow"}
];
ss.addMenu("Write Date", menuEntries);
}
function writeNow() {
var currentSheet = SpreadsheetApp.getActiveSheet();
currentSheet.getActiveCell().setValue(Utilities.formatDate(new Date(), "GMT+9:00", "HH:mm"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment