Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onOpen(e) {
- DocumentApp.getUi()
- .createMenu('Copy active Range.')
- .addItem('Copy Button', 'Copy')
- .addToUi();
- }
- function Copy() {
- var ss = DocumentApp.getActiveDocument();
- var selection = ss.getSelection();
- var tss = SpreadsheetApp.openById("xxx");
- var ts = tss.getSheetByName("name");
- trange = ts.getRange("B6:B6")
- selection.copyto(trange);
- }
- var SPREADSHEET_ID; // = assign your spreadsheet id to this variable
- var SHEET_NAME; // = assign your sheet name to this variable
- function onOpen(e) {
- DocumentApp.getUi()
- .createMenu('Copy active Range.')
- .addItem('Copy Button', 'Copy')
- .addToUi();
- }
- function Copy() {
- var ss = DocumentApp.getActiveDocument();
- var selection = ss.getSelection();
- var tss = SpreadsheetApp.openById(SPREADSHEET_ID);
- var ts = tss.getSheetByName(SHEET_NAME);
- trange = ts.getRange(2, 6); //I think, you can use B6 also
- trange.setValue(String(selection));
- }
Add Comment
Please, Sign In to add comment