Googlesheets

How to Organize and Run Apps Script Functions with Custom Menus in Google Sheets?

If you’ve ever created a powerful function using Google Apps Script — maybe to send Emails, clean up data, generate invoices, or sync records — the next logical question is:
“How do I make this usable for others?”

Most people either create buttons or leave instructions like “Go to Extensions → Apps Script → Run this function” — and both are far from ideal.

There’s a cleaner, more professional way to run your Apps Script functions inside Google Sheets:
👉 Custom Menus.

Custom menus help you bring your backend logic to the frontend. And they do it in a way that’s intuitive for any user — no buttons, no coding, no confusion.

Why Use a Custom Menu?

A custom menu is a dropdown that appears in the Google Sheets toolbar, right next to File, Edit, and Tools. But instead of Google’s built-in options, this one runs your own functions, written in Apps Script.

Here’s why it makes so much sense:

  • You can run your script in one click
  • You can create categories of scripts for better organization
  • You avoid cluttering the sheet with buttons
  • Users don’t need to touch the script editor at all

This turns a technical script into a user-friendly feature that anyone can access without guidance.

A Custom Menu With Categorized Functions

Here’s how you can create a structured custom menu with multiple levels:

function onOpen() {
const ui = SpreadsheetApp.getUi();
ui.createMenu('Admin Tools')
.addSubMenu(
ui.createMenu('Reminders')
.addItem('Send Invoice Reminders', 'sendInvoiceReminders')
.addItem('Send Due Summary to Salesmen', 'sendDueSummaryToSalesmen')
)
.addSubMenu(
ui.createMenu('Data Cleanup')
.addItem('Clear Date Validations', 'clearDateColumnValidations')
.addItem('Format Date Columns as Text', 'formatDateColumnsToPlainText')
)
.addItem('Backup Sheet Now', 'backupSheet')
.addToUi();
}

What This Script Does:

  • Runs when the sheet is opened.
  • Adds a new menu titled Admin Tools.
  • Organizes functions into two submenus: Reminders and Data Cleanup.
  • Also includes a direct menu item for actions like Backup.

This kind of organization helps you scale your internal tools, reduce confusion, and make it easier for anyone on your team to access powerful functions without needing technical support.

Conclusion

Custom menus make your Apps Script functions easier to find, easier to run, and easier to manage. Instead of relying on buttons or expecting users to open the script editor, you bring everything right to the menu bar — clean, simple, and accessible.

It’s a small step in terms of code, but a meaningful improvement in how your spreadsheets are used and shared.