Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can turn a repeatable Excel task into an Office Script without writing code: record the actions, stop the recording, then run the script to replay them. If you want more control, open the generated TypeScript in the code editor and make a small edit. Microsoft Support says, “You don’t need any coding experience to record and run Office Scripts.”

Before you start: check that Office Scripts is available

Microsoft’s recording guidance covers Excel for Microsoft 365 and Excel for Microsoft 365 for Mac. Availability can also depend on your account and organization settings. For the sharing scenario Microsoft documents, users need an active Microsoft 365 account with a qualifying commercial or educational license, server authentication to save scripts to the cloud, and an administrator who has enabled the feature. Check Microsoft’s current Office Scripts sharing and access guidance for applicability; account access is not identical for every consumer or organization, and Microsoft notes exclusions for Microsoft 365 for US Government and customers with data residency in certain newer local datacenter geographies.

Record a repeatable task

  1. In Excel, open the Automate tab and select Create from Recording. Microsoft’s walkthrough first shows the script options, including New Script and View Scripts, before choosing the recording option.

  2. Perform the workbook actions you want the script to repeat. The recorder can capture tasks such as entering text or numbers, formatting cells, rows, or columns, and creating tables. The Record Actions pane shows the captured steps in order.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    #1 Best Overall
    Sale
    The Microsoft Office 365 Bible: The Most Updated and Complete Guide to Excel, Word, PowerPoint, Outlook, OneNote, OneDrive, Teams, Access, and Publisher from Beginners to Advanced
    • The Microsoft Office 365 Bible: The Most Updated and Complete Guide to Excel, Word, PowerPoint, Outlook, OneNote, OneDrive, Teams, Access, and Publisher from Beginners to Advanced
    • ABIS BOOK
  3. Select Stop. Excel creates a script and displays it in the Office Scripts task pane. Rename the default script name to one that makes its purpose easy to recognize.

  4. Select Run to replay the recorded actions. Review the result in the worksheet, especially if the task changes data or creates objects such as tables.

Microsoft’s walkthrough is available at Record your actions as an Office Script.

Choose absolute or relative recording

The recording mode determines how the script locates cells when you run it. Choose based on whether the task belongs to fixed worksheet addresses or to wherever you start.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Microsoft 365 Personal | 12-Month Subscription | 1 Person | Premium Office Apps: Word, Excel, PowerPoint and more | 1TB Cloud Storage | Windows Laptop or MacBook Instant Download | Activation Required
  • Designed for Your Windows and Apple Devices | Install premium Office apps on your Windows laptop, desktop, MacBook or iMac. Works seamlessly across your devices for home, school, or personal productivity.
  • Includes Word, Excel, PowerPoint & Outlook | Get premium versions of the essential Office apps that help you work, study, create, and stay organized.
  • 1 TB Secure Cloud Storage | Store and access your documents, photos, and files from your Windows, Mac or mobile devices.
  • Premium Tools Across Your Devices | Your subscription lets you work across all of your Windows, Mac, iPhone, iPad, and Android devices with apps that sync instantly through the cloud.
  • Easy Digital Download with Microsoft Account | Product delivered electronically for quick setup. Sign in with your Microsoft account, redeem your code, and download your apps instantly to your Windows, Mac, iPhone, iPad, and Android devices.
Mode How it targets cells Best fit
Absolute Records exact cell positions. If you edit A3 while recording, a run targets A3 again. Tasks that always apply to known addresses.
Relative Records positions relative to the cell selected when recording starts. In Microsoft’s example, starting at A1 and editing A3 means the script targets two rows below the selected starting cell on a later run. Tasks that should follow the active selection and nearby cells.

Absolute mode is the default. When the task should move with the active cell, select relative mode before recording; when it should always affect the same addresses, keep absolute mode.

Open and make a small TypeScript edit

Recording is the no-code step; editing is optional. To see how a recording is represented, open the script in the code editor and inspect its generated TypeScript. Microsoft’s Office Scripts recording tutorial uses sample fruit-sales data: it records orange fill formatting, adds a line to color another row yellow, and then creates and sorts a table.

A small code change can extend a recorded task, but change only the part you understand and run the script on appropriate data to check the result. The generated code is what Excel replays; it is not a natural-language description of the actions.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check whether the script is safe to run again

A recorded script does not automatically make a task safe to repeat. Some operations can be performed again without harm; others can fail or change the result on a later run. In Microsoft’s tutorial, the example errors if it is run again on the same worksheet after it has created a table, because Excel cannot create another table over the existing one. To continue that lesson, Microsoft recommends creating a new worksheet, pasting the sample data there, and running the script again.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Before reusing your own script, check whether it creates something that already exists, overwrites values, or depends on a particular worksheet layout. If a rerun fails, inspect the worksheet for changes from the first run and adjust the starting data or script before trying again.

Sharing scripts and workbook access

Microsoft says a script associated with a workbook can be viewed and run by people who have write access to that workbook, and that Office Scripts can be shared within an organization, not with external users. A person’s first run of a script owned by someone else requests permission to view and edit the workbook. Consider that workbook access implication before sharing a script, and consult Microsoft’s sharing documentation for current account, administrator, and tenant requirements.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.