Created
September 28, 2015 16:11
-
-
Save olostan/83fa808e7885f929230a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adds a custom menu with items to show the sidebar and dialog. | |
* | |
* @param {Object} e The event parameter for a simple onOpen trigger. | |
*/ | |
function onOpen(e) { | |
SpreadsheetApp.getUi() | |
.createAddonMenu() | |
.addItem('Add Quotes', 'addQuotes') | |
.addToUi(); | |
} | |
/** | |
* Runs when the add-on is installed; calls onOpen() to ensure menu creation and | |
* any other initializion work is done immediately. | |
* | |
* @param {Object} e The event parameter for a simple onInstall trigger. | |
*/ | |
function onInstall(e) { | |
onOpen(e); | |
} | |
function addQuotes() { | |
var range = SpreadsheetApp.getActiveSheet().getActiveRange(); | |
var values = range.getValues(); | |
for (var i = 0;i<values.length;i++) { | |
values[i][0] = "'"+values[i][0]; | |
} | |
range.setValues(values); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment