Automatically Move Completed Tasks to an Archive (with Excel Office Scripts & Power Automate) @LeilaGharani
Automatically Move Completed Tasks to an Archive (with Excel Office Scripts & Power Automate)  @LeilaGharani
Uploaded April 2023 | Updated December 2026, 3 hours ago
Move "done" tasks to an archive table every night, automatically, with Office Scripts and Power Automate.
πŸ“₯ Download the script and file: pages.xelplus.com/automate-scripts-file?utm_source=yt-video&utm_medium=vid-description&utm_campaign=download-automate-scripts&utm_content=office-scripts-archive-tasks

πŸŽ“ Excel courses for busy professionals (500,000+ enrolled in our courses): link.xelplus.com/yt-d-all-courses

As a project manager, I had to move completed tasks to an archive every evening by hand. Here I record the steps with Office Scripts, fix what the recorder gets wrong, and schedule the script in Power Automate so it runs at 10 PM while the file is closed.

The recorder gets you started, but it copies the whole table instead of only the visible rows. I show you how to copy only the filtered rows, paste them below the archive table, and loop from the bottom up to delete the done tasks.

βœ… Good to know
The Automate tab has changed since this video. To record, go to Automate, then New Script, then Create from Recording.
Office Scripts need a Microsoft 365 business license that includes them, and your admin can turn them off.
Save the file on OneDrive for Business or SharePoint, so Power Automate can run the script when the file is closed.
Delete rows from the bottom up. Deleting from the top shifts the rows you haven't checked yet.
Add a check that skips the copy when there are no done tasks, or the script runs with errors.

⏱️ Chapters
00:00 Move done tasks to an archive automatically
00:37 Why I needed this as a project manager
02:01 The task tracker and the archive table
02:51 What you need: Automate tab and admin settings
03:13 Record your actions with Office Scripts
05:23 Test the recorded script
06:04 Why the recorded script only half works
06:42 Read the recorded code
07:17 Copy only the visible rows
08:10 Paste below the archive table with getResizedRange
10:38 Find the syntax in the Office Scripts API reference
11:13 Loop from the bottom and delete done rows
14:03 Debug with console.log
14:36 Test the finished script
15:12 Schedule the script with Power Automate
17:13 Test the flow manually
18:20 Skip the run when there are no done tasks

🎬 Related videos:
Introduction to Office Scripts: youtu.be/fny4zUycp_w
Office Scripts and Power Automate for boring Excel tasks: youtu.be/v-_joMcPpLI

➑️ Join this channel to get access to perks: youtube.com/channel/UCJtUOos_MwJa_Ewii-R3cJA/join

βœ‰οΈ Get one practical Excel tip every week in our free newsletter, Between the Sheets: link.xelplus.com/yt-d-newsletter

🚩 Connect with us:
Instagram: instagram.com/lgharani
LinkedIn: linkedin.com/in/leilagharani

#officescripts #powerautomate #excel
Automatically Move Completed Tasks to an Archive (with Excel Office Scripts & Power Automate)How to Find Duplicates in Excel (Fastest 4 Methods)REGEXEXTRACT and REGEXREPLACE in Excel (Real Examples)Quick hello and letting you know about our new Python in Excel courseEasiest Way to Share Screen in Teams with Windows 11 #shortsHow to Use Copilot in Excel (Real Examples)Windows 11 Finally Fixed the Taskbar (And Added These Useful Settings)Find Your Excel Tools Quickly - New Feature #shortsGreat Power Query Tip ▢️ How to Import Entire File Content in Excel or Power BI #shortsA Cool Way to add Timestamps to Excel #excelCan AI Write DAX in Power BI? What to Watch Out ForYou Wont Believe These Crazy PIVOT TABLE Hacks!
Leila Gharani |

Automatically Move Completed Tasks to an Archive (with Excel Office Scripts & Power Automate)

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER