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
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










