Who This Guide Is For
This guide is for anyone at work who repeats the same Excel job every week, such as cleaning an export, building a report or copying rows into another file, and wants Excel to do it instead. It’s written for an office manager or finance assistant who knows Excel well but doesn’t write code for a living. It covers the four tools Microsoft gives you for this, in the order most people should try them, and the signs that the job has outgrown Excel.
Before You Start
You need two things before choosing a tool.
First, a clear description of one job. Pick a single task you do on a schedule, and note what starts it, what goes in and what should come out. “Every Monday I download last week’s orders from the online shop as a CSV, delete six columns, fix the dates, add a margin column and paste the result into the sales report” is the level of detail you want.
Second, know which Excel you’re on. Office Scripts and Power Automate’s Excel connector need a work or school Microsoft 365 account with the file stored in OneDrive for Business or SharePoint. If your workbooks live on a shared drive in the office, or you use a home licence, some of what follows won’t be open to you yet. Microsoft’s documentation lists Office Scripts as preview-only on personal and family plans.
Step 1: Turn Your Data Into a Proper Table
Before automating anything, select your data and press Ctrl+T (Cmd+T on a Mac) to make it an Excel table, with one header row, one record per row and no blank rows or merged cells in the middle.
It sounds like housekeeping, but most of the tools below depend on it. Power Automate’s Excel actions, such as listing rows or adding a row, only work on data inside a table. Power Query reads tables cleanly, and a table grows when new rows arrive, so formulas and scripts aimed at it keep working as the data gets longer. A macro recorded against A2:F200 will run happily the week you have 201 rows and leave the last one out.
Step 2: Use Power Query for Anything That Cleans or Combines Data
If the job is mostly “get data in and tidy it up”, Power Query is the right tool and it needs no code. You find it under Data and then Get Data. You point it at a CSV, a folder of files, another workbook or a database, then make the changes once: delete columns, split names, change text to dates, filter out test orders, merge two sources on a customer number. Power Query records each step. Next week you drop the new export in the same place and press Refresh All, and every step runs again in order.
Using the Monday example, the query would load the CSV from a fixed folder, remove the six unused columns, set the order date as a date, add a margin column and load the result into a table on the report sheet. The weekly job becomes saving the file in the folder and pressing one button.
Step 3: Use a Macro or Office Script for Repeated Actions Inside the Workbook
When the job is a sequence of actions rather than a data clean-up, such as formatting a sheet, creating a PivotTable, hiding columns before sending, or copying today’s figures to a history tab, record it.
There are two recorders, and the choice depends on where your files live.
- VBA macros run in the desktop versions of Excel. Use the recorder on the Developer tab, then save the workbook as .xlsm. They’re mature and can do almost anything on your own machine. Microsoft now blocks macros by default on Windows in files that came from the internet, which includes email attachments. A macro workbook you email to a colleague can arrive with its macros switched off and a security banner across the top.
- Office Scripts live on the Automate tab in Excel on the web, and in Excel for Windows and Mac on a business licence. The action recorder turns your clicks into a script you can edit, written in TypeScript. Scripts are saved in your OneDrive and can be shared with anyone who has access to the workbook, including as a button on the sheet. Because they run in the cloud, a Power Automate flow can run them on a schedule or when something happens.
If your team works from files in OneDrive or SharePoint, start with Office Scripts. If everyone works in desktop Excel from a shared drive and the files never leave the office, a macro is fine.
Record the steps on a copy of the file, then open the code and look for anything tied to a fixed cell address or a sheet name that might change. Replace those with references to the table from Step 1.
Step 4: Use Power Automate When Excel Has to Talk to Something Else
Power Automate is for jobs that start or end outside the workbook. A typical flow saves every email attachment from a supplier into a folder, then runs your Office Script on the new file and posts a message in Teams when the report is ready. Another adds a row to an Excel table each time a Microsoft Form is submitted.
It works well for this, within limits that Microsoft publishes for the Excel Online (Business) connector:
- The workbook must be in OneDrive for Business, SharePoint or a Microsoft 365 group, and the data must be in a table.
- Files over 25 MB aren’t supported.
- “List rows present in a table” returns 256 rows by default. Unless you turn on pagination, a flow that reads a growing table will start missing rows without telling you.
- Changes can take up to 30 seconds to appear, and a file can stay locked for up to six minutes after the connector last used it.
- Running a script is limited to 3 calls every 10 seconds and 1,600 a day.
- Microsoft doesn’t support several people or flows writing to the same file at the same time. Someone editing the workbook while a flow writes to it is a common source of conflicts and duplicated rows.
Script scheduling inside Office Scripts was temporarily disabled when we checked Microsoft’s documentation in October 2026, and Microsoft points people to Power Automate for running scripts on a timer. Build the schedule as a flow with a recurrence trigger.
Step 5: Test It Against Last Month
Before you trust it, run the automation against data where you already know the right answer. Take last month’s exports, run the query, script or flow, and compare the result with the report you built by hand. Check the totals, the row counts and two or three individual rows end to end. Try one awkward input on purpose, such as an empty export, a file with an extra column or a name with an apostrophe, and see what happens. An automation that fails loudly is fine. One that produces a plausible wrong number is the risk.
Step 6: Write Down How It Works and Who Owns It
Put a short note on a “Read me” sheet in the workbook: what the automation does, where the input comes from, what triggers it, and who to ask when it breaks. Office Scripts are saved in the OneDrive of the person who wrote them, and a flow belongs to the account that built it, so decide now what happens when that person leaves. Move ownership to a shared team account or SharePoint library while the builder is still around to help.
Common Mistakes
- Building the automation before agreeing the output with whoever reads it. A report that’s produced automatically in the wrong layout gets rebuilt by hand every week anyway.
- Leaving heavy formulas in a workbook that a flow writes to. Microsoft notes that recalculation can make the connector time out, and its retry can then insert the same rows twice. Keep calculations on a separate sheet, or switch the workbook to manual calculation.
- Testing a flow only under your own login. Every action needs write access to the file, and a read-only copy returns an error the first time someone else’s flow touches it.
- Putting the whole job in one long flow. Split it into small steps (fetch, clean, report, notify) so that when one fails you know which, and can rerun just that part.
What Good Looks Like
Nobody does the Monday job any more. The file arrives, the query refreshes and the report is waiting at seven o’clock, or someone presses one button. The workbook holds one table per kind of record, a “Read me” sheet and an owner account that outlives any one employee. When something goes wrong, someone gets an error message. You also know which limit you’re closest to, whether that’s file size, row count or several people needing to edit at once.
When Excel Has Done Its Job
Some of the limits above are worth reading as signals. Several people entering data at once, a file heading for 25 MB, a flow fighting a person for the same workbook, or a need for each user to see only their own rows all mean the data wants to live in a database with Excel as a view on it. What breaks when you run on spreadsheets describes how that usually shows up. Our guide on how to migrate from spreadsheets to a proper system walks through the move itself, and Can you replace our spreadsheets? covers what a replacement looks like.
Next Steps
If one well-built Power Query or flow solves the problem, stop there. If the job connects several systems, runs at volume or has to be dependable when nobody is watching, plan it as a project: how to plan a workflow automation project covers scoping, and Zapier vs a custom integration compares low-code tools with a custom build. When you’d rather have it built for you, that’s our business automation work. More step-by-step guides are in the guides library.
Written by
Alex
CEO
I’m a software developer and CEO of Digital Royalty, helping growing teams scale their SaaS platforms without losing quality, visibility, or control. I focus on building structured, maintainable systems with clear processes, reporting, and accountability. With over a decade of experience across agency and in-house roles, I specialise in delivering long-term, scalable solutions that support complex, evolving products.