. How Can you adign context in a spreadsheet
Answers
Answered by
2
Answer:
1
You can create a menu with button that will run the script that you want using the onOpen function. See the Apps Script documentation.
function onOpen() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var entries = [{
name : "Read Data",
functionName : "readRows"
}];
sheet.addMenu("Script Center Menu", entries);
};
You would then have some other function like this.
function readRows() {
This can execute any function you want, and you can have multiple menu items that do different things.
Note: onOpen sometimes takes a while to load, so wait 5 seconds.
Similar questions
Geography,
8 days ago
Computer Science,
8 days ago
English,
8 days ago
Accountancy,
17 days ago
Physics,
17 days ago
Hindi,
9 months ago
Chemistry,
9 months ago
Science,
9 months ago