Complete Guide: How to Insert Spin Button in Google Sheets 2021

While working on Microsoft excel it can be easy to insert a spin button or other shapes, the same cannot be true for Google sheets.

This step-by-step guide will help you add a spin button in Google Sheets.

How to insert Spin Button in Google Sheets

Step 1: Inserting Shapes which will look like the Spin button.

  • On the Main menu go to the insert option ( Main menu ->Insert )

Under Insert menu. select Drawing as shown below

  • Under drawing, option click on shapes
  • In this example, I have selected the up arrow. You can also select other shapes
  • Click anywhere on the drawing area and it will insert the previously selected arrow sign.You can resize the arrow as per your requirement.
  • Now click on save and close


  • After saving you can find the selected shape in your google sheets.
  • Similarly, add down arrow and rectangle .

Once both the shapes are inserted in google sheets. You can resize them as per your need.

Once you are finished adding the shapes the final output will look like this :

The next step will be to add a google script code for each button

Step 2 : Writing a Google script for each button

Here we will use the increment and decrement function.

code for increment and decrement function.

Increment Number by 1:

function increment() {
 SpreadsheetApp.getActiveSheet().getRange('A10').setValue(SpreadsheetApp.getActiveSheet().getRange('A10').getValue() + 1);
}

Decrement Number by 1:

function decrement() {
 SpreadsheetApp.getActiveSheet().getRange('A10').setValue(SpreadsheetApp.getActiveSheet().getRange('A10').getValue() - 1);
}

Follow the below steps to add the above code to google sheets.

  • Go to script editor under the tools menu .
  • Once you click on the Script Editor it will open the Apps Script editor
  • Copy and paset the previously mentioned increment and decrement functon code in code.js window.
  • Save the project and close the Apps script editor

The above steps will add the increment and decrement function in your google sheets.

The next step is to assign these functions to the shapes added to our google sheets.

How to assign google script to the Shapes.

Follow the below steps to assign the google script.

  • Select the shape (in this example up arrow ) and click on the three dots as shown below.Once you click on three dots you will get the option to assign script.
  • Click on Assign a script.
  • Specify the name of the function ( in this example increment )
  • Similarly, assign the decrement function to a down arrow shape.
  • Once both the functions are assigned click on any arrow .
  • During the first run it will take some time and you will get a below message “Running script”
  • After that it will ask you for authorization .Click on continue and provide the authorization.
  • Now your spin button is ready. You can click on the up and down arrow to increment as shown below.
How to Insert Spin Button in Google Sheets

The above-provided steps will help you to add a spin button easily to your google sheets.

Other useful Articles.

How to add code blocks in google docs

To know more about Google Apps Script. Check the below-provided link

official google apps script documentation

Leave a Comment

Your email address will not be published.