NEWExcel AI Agents: use Copilot and Claude in Excel, and prove every number is right. Excel AI Agents course. See the course →

How to Automate Excel Tasks with Office Scripts (No VBA)

Grab Your Free Workbook Now! 📥

 

Follow step-by-step and boost your learning.

It’s practical, easy, and totally free. Get started today!

 

🔔 SUBSCRIBE if you’d like more tips and tutorials like this

 

We respect your privacy. Unsubscribe at any time.

Delete Thousands of Numbers Instantly in Excel! #excel #shorts

Andreas Exadaktylos May 23, 2026 18:09

Your Excel Charts Are Wrong | Here's Why & How to Fix It

Andreas Exadaktylos May 9, 2026 16:21

Master the Excel FILTER Function in 30 Seconds 📊 #Excel

Andreas Exadaktylos April 27, 2026 16:53

Build a Budget in Excel in 10 Minutes — and See If You're Actually Broke

Andreas Exadaktylos April 19, 2026 16:13

The Excel Button You’ve NEVER Used 🤫 #exceltips

Andreas Exadaktylos April 17, 2026 14:00

STOP scrolling manually in Excel! 🛑

Andreas Exadaktylos April 3, 2026 17:04

Watch: record your first Office Script in 5 minutes

Prefer reading? The same steps are written out below the video.

Step-by-step

Office Scripts let you record a set of actions once and replay them with one click. You don’t write any code: Excel writes it for you while you work. The example below fixes a print layout that doesn’t fit on the page.

1. Spot a task you repeat

Go to File > Print. In the example the sheet prints in portrait on A4 and spills across several pages. Making it landscape on wider paper is something you’d otherwise redo on every sheet.

2. Start recording

Before changing anything, go to the Automate tab, click New Script and choose Record Actions. A pane opens on the right and records everything you do from now on.

No Automate tab? Your Microsoft 365 plan may not include Office Scripts, or an administrator may have turned them off.

3. Do the steps once

Go to Page Layout > Orientation > Landscape, then Size > Legal (or whichever paper you need). Each action appears in the Record Actions pane as you go. Click Stop when you’re done.

4. Name the script

Click the script name and change it to something descriptive, such as Print wide. Add a short description too, for example Changes to landscape using legal-size paper. Press Enter to save each.

5. Run it on another sheet

Go to a sheet that still prints in portrait. Click Automate > All Scripts, pick Print wide and click Run. Check File > Print: the sheet is now landscape and fits on one page.

6. Look at the code (optional)

Click Edit on the script to see the TypeScript Excel wrote from your actions. You never need to touch it, but it’s a good way to learn if you’re curious.

Go further

My Excel Tips & Shortcuts: 100+ Powerful Hacks course collects a hundred time-saving techniques like this one.

WATCHING ON YOUTUBE?

The full courses go further

11 step-by-step courses on Excel, Power BI, Python and AI, all on Udemy with lifetime access.