Create Custom menus in Google Sheet Script

Custom menus in Google Sheet Script

The following is used to create custom menus in Google sheet script. The new menus can be quickly used to run the program.

function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Custom Menu1')
.addItem('First item1', 'menuItem11')
.addItem('Second item1', 'menuItem21'))

function menuItem11() {
.alert('You clicked the first menu item1!');

function menuItem21() {
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.alert('You clicked the second menu item1!');


About the author: Explore SARCS

You must be logged in to post a comment.