Yes. Google Sheets has a built-in macro recorder: in a spreadsheet open in a desktop browser, choose Extensions > Macros > Record macro, perform the actions you want to repeat, and save the recording. Sheets turns those recorded actions into Google Apps Script, which you can run again from the Macros menu or edit in the script editor.
What the Google Sheets macro recorder does
A macro is a saved sequence of spreadsheet actions. It is useful when you repeatedly carry out the same steps, such as applying a standard format to a report, adjusting a range, or preparing a recurring worksheet. Instead of repeating each action by hand, you run the macro and Sheets replays the recorded instructions.
The recorder is part of Google Sheets, not a separate download or a general-purpose recorder for every Google app. A recorded macro is implemented as a function in Apps Script, Google’s JavaScript-based automation environment. That connection is important: recording can get a basic automation started without writing code, but the result is still a script that can be inspected and changed.
Macros are associated with the spreadsheet in which they are created. They are not the same as a formula: a formula calculates a result in a cell, while a macro performs a sequence of actions. For example, a formula might total a column whenever its inputs change; a macro might apply formatting to a selected report when you choose to run it.
How to record a macro
Use Google Sheets in a desktop web browser. The mobile apps do not provide the full recording and Apps Script editing workflow. To make a basic recording:
- Open the spreadsheet and, if appropriate, make a copy to use as a safe practice file.
- Choose Extensions > Macros > Record macro.
- In the recording controls, choose whether to use absolute or relative references. The choice affects how recorded cell selections behave when the macro runs.
- Perform the actions you want Sheets to repeat. Keep the sequence focused, and avoid unrelated clicks or edits.
- Stop the recording, give the macro a name, and save it. You can also assign a keyboard shortcut in the save dialog if that option is offered.
For example, a monthly report routine might select a header row, apply bold text and a fill color, format a date column, and resize columns. Record those steps on a representative sheet, save the macro, and run it on a similar report. The recorder captures actions, not your reasons for taking them, so a short, consistent sequence is easier to reuse than a long recording full of exploratory clicks.
Absolute and relative references
The recorder’s reference choice determines whether recorded actions target the same cell locations every time or move relative to the current selection. An absolute recording is appropriate when the macro should always work on a fixed location, such as a title in cell A1. A relative recording is more suitable when the same operation should apply near whichever cell or range you select before running it.
Imagine recording a formatting action while a header is in row 1. With an absolute reference, replaying the macro is designed to target that recorded location. With a relative reference, the action can be applied in relation to the active cell or selection at run time. This distinction matters if a weekly report’s data starts in a different row, or if the same layout is repeated in several sections.
Test the macro on a copy and on a small sample before using it on a full sheet. A recording that relies on a particular active cell, selection, or layout may produce an unexpected result if the sheet changes. Relative recording does not make a macro universally adaptable: it still repeats the recorded operations and may need editing if the structure or task changes.
What it can and cannot record
The recorder is best for straightforward, repeatable operations performed through the Sheets interface. It can turn many ordinary formatting and sheet-editing actions into script instructions. The generated script can also be extended for logic that is beyond a simple replay, such as checking a condition before changing data, but that requires working with Apps Script.
A recording is not a live rule that automatically reacts to every later change. It runs when someone invokes it, unless a developer adds a suitable trigger or other automation in Apps Script. Nor does the recorder understand a vague goal such as “clean up this data.” It captures the particular actions you take; it does not infer how to handle every possible input or exception.
Do not assume that every menu command, external service, or complex workflow can be captured successfully. Some tasks need script code, permissions, or a different automation tool. If an action is absent from the resulting code or does not replay as expected, inspect the script and check whether the task is supported through Apps Script. For one-off work, manual editing may be safer and quicker than building a macro.
Running and editing a recorded macro
After saving, run a macro from Extensions > Macros and choose its name. If you assigned a shortcut, use the shortcut shown for that macro; the menu is the dependable option when you have not assigned one or cannot remember it. A macro may need authorization the first time it runs, depending on what its generated or edited script does. Read the permission request and grant access only when you understand and trust the script.
To inspect or change the generated code, choose Extensions > Apps Script. The macro appears as a function in the spreadsheet’s bound script project. A recorder-generated function can be useful as a starting point, but code edits require care: a syntax error or an incorrect range can prevent the macro from running or make it change the wrong cells. Save changes in the script editor and return to the spreadsheet to run the macro.
Some common reasons to edit the code include making a range dynamic, removing an unwanted recorded action, or adding a condition. If you only need the macro to repeat the same uncomplicated steps, editing is optional. If the task needs to make decisions, handle variable-sized data, or run on a schedule, expect to learn at least the relevant Apps Script basics or ask someone with scripting experience to review it.
Common problems and practical fixes
- The Macros menu is missing or unavailable: Confirm that you are using Google Sheets in a desktop browser and that the file is a Google Sheets spreadsheet. If the file is still an Excel-format workbook, convert or save it as a Google Sheets file before relying on Sheets features. A work or school administrator may also restrict Apps Script.
- The macro changes the wrong cells: Check whether you recorded absolute or relative references, what cell or range is selected before running it, and whether the current sheet has the same layout as the one used for recording.
- The macro asks for permission: This can be normal for Apps Script. Review the requested access and make sure the spreadsheet and script are trusted. If you do not recognize the code or the permission request seems broader than the task requires, do not approve it until it has been checked.
- The macro does not behave like the recording: Confirm that the relevant sheet is active, selections and data are in the expected places, and the recorded sequence still matches the current layout. Open Extensions > Apps Script to inspect the generated function for errors or unintended steps.
- Other users cannot run it as expected: Check their access to the spreadsheet and whether they can authorize the script. Workspace sharing policies can affect Apps Script access, so an administrator may need to clarify an organization’s restrictions.
When a macro makes unwanted changes, use the spreadsheet’s version history or restore a safe copy rather than assuming every script action can be undone like ordinary typing. Test consequential edits on a duplicate first, especially when the sheet contains important shared data.
Google Sheets macros compared with Excel macros
Both Google Sheets and Microsoft Excel can automate repeated spreadsheet work, but their macro systems are different. Sheets records actions into Apps Script, while Excel’s traditional macro system uses VBA. A Sheets macro is not a VBA macro, and copying its script into Excel will not make it run there. Similarly, VBA code cannot simply be pasted into the Apps Script editor.
Sheets is a natural fit when the spreadsheet already lives in Google Drive and collaborators need browser-based access. Excel may be a better fit for workbooks built around VBA, desktop-only features, or an organization’s Microsoft 365 workflow. If a task needs to work across both products, plan on building and maintaining separate automation rather than expecting the recording to transfer unchanged. For large or complex Google Workspace automation, Apps Script offers more control than the recorder, while still using the Google Sheets environment.
Cost, access, and safety
The macro recorder is a feature within Google Sheets; there is no separate recorder purchase. Access to Sheets may be through a personal Google account or an organization’s Google Workspace account, whose available services and administrative controls can differ. If a menu or script feature is blocked in a managed account, check with the Workspace administrator rather than assuming the feature is broken.
Treat a macro as code, particularly in a shared spreadsheet. A container-bound script is associated with its spreadsheet, and people who can edit a file may have access to its associated project, subject to Google’s sharing and account policies. Review a script before running one supplied by someone else. Avoid granting permissions without understanding the request, and do not use a macro to process sensitive information unless the account’s policies and the script’s behavior are appropriate.
Good habits reduce risk: keep an untouched copy of important data, test with a small sample, name macros for their purpose, and document any assumptions about the active sheet or selection. These steps are useful even for a simple formatting macro because a recorded sequence can repeat an error just as reliably as it repeats the intended action.
Frequently Asked Questions
Does Google Sheets have a macro recorder?
Yes. In a desktop browser, use Extensions > Macros > Record macro. Sheets saves the recording as an Apps Script function associated with the spreadsheet.
Can I record a macro in Google Sheets on my phone?
The full recorder and Apps Script editing workflow is intended for the desktop web version of Sheets. Use a computer browser to record or edit macros; the mobile apps do not offer the same tools.
Where do I find my recorded macro?
Run it from Extensions > Macros in the spreadsheet where it was created. To inspect or edit its code, open Extensions > Apps Script.
Can a Google Sheets macro run automatically?
A recorded macro normally runs when a user invokes it from the menu or an assigned shortcut. Automatic or event-based behavior requires additional Apps Script work, such as setting up an appropriate trigger, and may involve permissions.
Are Google Sheets macros the same as Excel macros?
No. Sheets macros use Apps Script, whereas traditional Excel macros use VBA. The code and supported features are different, so a macro generally needs to be recreated or rewritten when moving between the products.
Why is my recorded macro affecting the wrong range?
Check the absolute or relative reference setting, the active selection when you run it, and whether the current sheet matches the layout used during recording. Try it on a copy before making changes to the live data.
Related
- Excel Text to Columns: How to Keep Leading Zeros Safely
- Excel Table Dropdown List: Create and Manage Lists
- Excel Tab Shortcut Keys: Move Between Worksheets
Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.
More in VBA & macros
- Excel VBA Array Methods: Create, Resize, and SearchExcel VBA does not provide a single built-in “array methods” object: instead, it offers array functions and statements…
- VBA: Update a PivotTable Filter with CodeTo update a PivotTable filter with VBA, reference the PivotTable and its field, clear any existing filter, then…
- Excel VBA Current Date: Date, Now, Formatting, and ExamplesIn Excel VBA, use Date to get the computer’s current date, without a time; use Now to get…
- Excel VBA Button: Add, Assign, and Fix Macro ButtonsAn Excel VBA button is a clickable control that runs a macro in a workbook. In Excel for…
- VBA Range Union: Combine Separate Ranges in ExcelIn VBA, use Application.Union to combine two or more ranges on the same worksheet into one Range object,…
- VBA Code to Copy and Paste Values in ExcelTo copy a range’s results without its formulas, use VBA’s PasteSpecial with xlPasteValues; for a fast transfer between…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.