What is a custom menu in Google Sheets?
A custom menu is a menu bar section your Apps Script adds with SpreadsheetApp.getUi().createMenu(), typically from an onOpen trigger. It gives teammates one-click buttons for exports, sorts, or wizards instead of remembering hidden functions.
When to use it
Use custom menus when non-technical editors need safe, labeled actions on a shared ops sheet.
When to skip it
Skip menus for personal one-user sheets where keyboard shortcuts or macros are enough.
How it works
-
1
Write onOpen that builds menu items linked to function names.
-
2
Keep menu labels short and action-oriented.
-
3
Authorize script on first menu click if needed.
-
4
Document each item in README tab.
-
5
Hide dangerous dev items before client handoff.
Examples in Google Sheets
Export menu
Custom Export menu sends CSV of filtered range to Drive folder.
Better Sheets resources
Common mistakes
-
Menu item calls a renamed function causing silent failure.
-
Too many items without separators.
-
onOpen fails for viewers who cannot run simple trigger.
Frequently asked questions
- Custom menu vs macro?
- Macros record UI steps. Custom menus call functions you wrote with full logic.
- Refresh menu?
- Close and reopen the sheet or rerun onOpen during testing.
Related Tutorials
Watch how custom menu works
Spreadsheet Automation 101 Lesson 1: onOpen() Trigger - Custom Menu
Breaking Through Errors In Apps Script
Make a Tour of Your Sheet
Add-on menu on open
Activate A Certain Sheet When Opening a Spreadsheet
Advanced Coding in Google Sheets for Programmers
Related blog posts
Guides that explain custom menu in more depth.
What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →Spreadsheets Explained! 5 Levels of Difficulty: From Basic Text Input to Google Apps Script
Five increasingly difficult ways of explaining spreadsheets in Google Sheets: The basics of Google Sheets text Menu items in Google Sheets Math inside Google Sheets Using Formulas in Google Sheets Apps Script in Google Sheets
Read post →Related terms
onOpen trigger
The onOpen trigger runs an Apps Script function automatically when someone opens the spreadsheet. It is the standard way to add custom menus, show instructions, or refresh lightweight cache without asking the user to run a macro first. Name the function onOpen or bind it as an installable open trigger.
Read guide →Script Editor
The Script Editor is the Apps Script workspace inside your spreadsheet where you write JavaScript that talks to Sheets, Gmail, and other Google services. You open it from Extensions > Apps Script. Every function you save can be run manually, bound to a trigger, or linked from a custom menu.
Read guide →Google Apps Script
Apps Script is Google's JavaScript platform for automating Sheets and other Workspace apps. From a spreadsheet you can open Extensions > Apps Script to write code that reads cells, sends email, builds menus, and runs on triggers. It goes beyond formulas when you need custom workflows tied to your file.
Read guide →Google Sheets macros
A macro records your clicks and keystrokes in Google Sheets, then saves them as an Apps Script function you can run again from the Extensions menu or a keyboard shortcut. Macros are the fastest on-ramp to automation when your task is a fixed sequence of formatting or edits.
Read guide →Done reading about custom menu?
Membership unlocks 600+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.
Need this once
Jump to a free tool or a single tutorial for this topic.
Learning Sheets for real
Unlock the full library, generators, and templates with membership.