Can You Use Macros in Google Sheets in 2024?

Does Google Sheets have macros? The short answer is YES – you can use macros in Google Sheets.

What is Macro in Google Sheets?

Macro – as a computing term – means – a set of instructions/steps allows you to perform particular tasks.

In simple words, you can create steps in advance, and when you run the macro, these steps will be executed. An example would be deleting a set of rows/columns. As soon as you run the macro, it will go and delete the specified rows/columns in the specified worksheet.

Read Macro Guide

Although macro is a computing term, for people in the spreadsheet word, it mostly means the VBA macros (Visual Basic for Applications) in Excel spreadsheets.

So let me cover the important question first:

Do Excel Macros Work in Google Sheets?

If you have added an Excel file to Google Drive or have converted an Excel file into a Google Sheets document, the macros in the Excel file WILL NOT work. Remember, these are two different applications made by two different companies.

While Google Sheets is trying to accommodate a lot of what an existing Excel file can have, there are still some gaps, and they don’t support Excel macros.

And don’t expect that to change. While I love how easy it is to make macros in Excel, it’s not the same process in Sheets. Google has it’s own way of doing things, and I’ll show you exactly what to do below.

In short, you’ll need to use Google Apps Script (a JavaScript-based language built into Google Apps).

Can You Record Macros in Google Sheets?

YES – you can record Google Macros in Google Sheets!

This can easily be done. Just like you record macros in Excel, you can also do that in Google Sheets.

Once you record a macro in Google Sheets, you can go to the Script Editor and have a look at the code and modify it accordingly.

And that brings me to another burning question.

How Can You Use Excel Macros in Google Sheets?

As I have already mentioned that you can not run Excel macros in Google Sheets.

So the options are:

  1. Take the VBA code that you have in Excel and get it converted to Google Apps Script. If you don’t know GAS, you can hire a developer to get this done (someone who understands Excel and Google Sheets both)
  2. Record a macro in Google Sheets that closely resembles what the VBA code does. In many cases, this may not be possible (as macro recorder has limitations), but in case it can be done, this will give you a rough version of the Google Apps Script code that you can further refine.

Macro in Google Sheets Vs Excel Macros

I am not an expert in programming, but I do have (limited) experience with coding Excel macros in VBA and some in Google App Script.

Here are my thoughts (consider these as first impressions from a newbie):

  1. I find writing and learning VBA macros a bit easier (as compared with Google App Script). I think that’s universally true and VBA is easier than Java.
  2. There is a lot of help and documentation available for Excel VBA, but not enough for Google Sheets macros.
  3. While you can use Excel VBA to work with other applications, it’s not great with it. Google Apps Script excels in this area (pun intended!). You can use it to open and extract data from websites or work with other web-applications.

Does Google Sheets Have VBA/ What Language Does Google Sheets Use for Macros?

VBA in Google Sheets is not available unfortunately, instead Google Sheets uses its own programming language called Google Apps Script which is similar to JavaScript.

How Do I Create a Macro Button in Google Sheets?

Read my full guide on how to create a macro in Google Sheets.

To create a new macro, all you have to do is:

  1. Navigate to Tools > Macros > Record Macro

  2. Record the actions you want to save as macro
  3. Save the macro

I hope you found these macros in Google Sheets tips useful!

Build Your Own Macro

Other Google Sheets articles you may find useful:

Most Popular Posts

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts

Thanks for visiting! We’re happy to answer your spreadsheet questions. We specialize in formulas for Google Sheets, our own spreadsheet templates, and time-saving Excel tips.

Note that we’re supported by our audience. When you purchase through links on our site, we may earn commission at no extra cost to you.

Like what we do? Share this article!