Google Sheets Add Button With Apps Script Event

Create Script Event

Open App Scripts: Google Sheets -> Tools -> Script Editor

Create the following function.

function onClick() {  SpreadsheetApp.getUi().alert('Hello');}

Add Image Button

Google Sheet -> Insert

  • Image -> Image over Cells (Google image button generator to generate an Image Button)
  • Drawing: Draw your own button

Click on the 3-vertical-dot on the top-right corner of the imag/drawing, click Assign Script and put in onClick.


Click on the button.

NOTE: To show the 3-vertical-dot again, right click on the button.

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.