Can You Use Macros in Google Sheets in 2024?

Video google sheet vba

Are you wondering if Google Sheets offers macros? Well, the short answer is YES – you can indeed use macros in Google Sheets.

What is a Macro in Google Sheets?

Macros Sample

In computer programming, a macro refers to a set of instructions or steps that allow you to perform specific tasks. In other words, you can create pre-defined steps, and when you run the macro, those steps will be executed. For example, you can delete a set of rows/columns. As soon as you run the macro, it will delete the specified rows/columns in the specified spreadsheet.

Although the term “macro” is a computer term, for those working in the world of spreadsheets, it usually refers to VBA macros (Visual Basic for Applications) in Excel spreadsheets.

Now, let me address the important question first:

Do Excel Macros Work in Google Sheets?

If you have uploaded an Excel file to Google Drive or converted an Excel file into a Google Sheets document, Excel macros WILL NOT WORK.

While Google Sheets tries to support much of what an Excel file can offer, there are still some gaps, and it does not support Excel macros.

And I don’t think Excel macros will ever work in Google Sheets because Google Sheets has its own version of macros – Google Apps Script (a JavaScript-based language integrated into Google Apps).

Can You Record Macros in Google Sheets?

YES – you can record macros in Google Sheets!

It can be easily done. Just like you record macros in Excel, you can do the same in Google Sheets.

Once you have recorded a macro in Google Sheets, you can access the script editor to view and modify the code accordingly.

And that brings me to another burning question.

How Can You Use Excel Macros in Google Sheets?

As I mentioned earlier, you cannot run Excel macros in Google Sheets.

Here are the options:

  1. Take the VBA code you have in Excel and have it converted into Google Apps Script. If you’re not familiar with GAS, you can hire a developer to do it (someone who understands both Excel and Google Sheets).

  2. Record a macro in Google Sheets that closely resembles the VBA code. In many cases, this may not be possible (as the macro recorder has limitations), but if it can be done, it will give you an approximate version of the Google Apps Script code that you can further refine.

Macros in Google Sheets vs. Excel Macros

I’m not an expert in programming, but I have some (limited) experience with programming VBA macros in Excel and a few Google Apps Script macros.

Here are my thoughts (consider this as the first impressions of a beginner):

  1. I found writing and learning VBA macros a little easier compared to Google Apps Script. I believe this is universally true, and VBA is easier than JavaScript.

  2. There is plenty of help and documentation available for VBA Excel, but not enough for Google Sheets macros.

  3. While you can use VBA Excel to work with other applications, it’s not excellent in that domain. Google Apps Script excels in this area. 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?

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

How to Create a Macro Button in Google Sheets?

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

  1. Go to Tools > Macros > Record a Macro
  2. Record the actions you want to capture as a macro
  3. Save the macro

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

Note: This article has been written for bolamarketing.com. Visit Crawlan.com for more informative content.

Related posts