Monthly
Move old rows to an Archive sheet
Rows older than your cut-off leave the main table each month, keeping it fast and readable.
- Runs
- Monthly
- Apps
- Microsoft Excel
- AI
- Not needed
- Access
- Files.ReadWrite
Send this to your assistant
Create a ClickRuntime automation: on the 1st of each month, move rows in my Orders table with a Date older than 90 days to the Archive sheet.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Operational workbooks get heavy. A support log that started with fifty rows now holds twenty thousand, the file takes a full minute to open, formulas lag and filters are cluttered with tickets from two years ago. The team knows the old rows should move somewhere, but nobody wants to do it by hand, and cutting and pasting risks losing records or breaking the formulas that depend on the table.
Once a month, ClickRuntime reads the rows in your main table, finds those older than the number of days you choose, adds them to an archive table and deletes the originals from the main one. Then it emails you the count of rows moved, so you know it ran.
It suits teams with growing logs, trackers or order lists that need to stay fast while keeping their history.
What you get out of it
The workbook stays quick to open
Moving thousands of old rows out keeps the file small. People spend less time waiting for Excel and more time working with current data. A smaller file also means fewer crashes and less frustration.
History is kept, not deleted
Rows go into an archive table before they leave the main one, so you can still look up an old case or answer an audit question. Nothing is thrown away.
Formulas and charts stay accurate
With only recent rows in the main table, totals and charts describe the current period. People are not confused by figures that mix this month with three years ago. That makes month-to-month comparisons clearer.
No risky manual cutting and pasting
A person moving rows can easily skip some, paste them wrongly or delete the wrong range. An automated move applies the same rule every time. That also makes the process easier to trust.
A monthly rhythm prevents backlog
Small regular moves are easier than a yearly cleanup of enormous size. The file never grows to the point where it becomes a project to fix. Routine maintenance beats occasional heroic cleanups.
A count confirms what happened
The email states how many rows were archived. If the number looks wrong, such as zero for a month with lots of activity, you can check the file before the problem grows.
How it works
What happens, step by step
Once a month, ClickRuntime reads the rows in your main Excel table.
It picks out rows older than your cut-off, such as a year.
It copies them to the Archive table, then removes them from the main table.
You get an email saying how many rows were moved.
Before it runs live
- Connect Microsoft Excel
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Microsoft Excel steps into one automation
Under the hood
The code that runs this automation
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, notify
BOOK = "https://graph.microsoft.com/v1.0/me/drive/items/01ABCDEF.../workbook/tables"
KEEP_DAYS = 365
@on_trigger
def run(event):
h = {"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"}
rows = http.get(f"{BOOK}/Orders/rows", headers=h).json()["value"]
excel_cutoff = (date.today() - timedelta(days=KEEP_DAYS) - date(1899, 12, 30)).days # column A holds an Excel date
old = [i for i, r in enumerate(rows) if isinstance(r["values"][0][0], (int, float)) and r["values"][0][0] < excel_cutoff]
if not old:
return {"archived": 0}
http.post(f"{BOOK}/Archive/rows/add", headers=h, json={"values": [rows[i]["values"][0] for i in old]}).raise_for_status()
for i in reversed(old):
http.delete(f"{BOOK}/Orders/rows/itemAt(index={i})", headers=h)
notify.email_me("Old rows archived", f"Moved {len(old)} rows older than {KEEP_DAYS} days to Archive.")
return {"archived": len(old)}FAQ
Common questions
How does it decide which rows are old?
Is it safe to delete the originals?
Can I archive only rows with a certain status?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Refresh an Excel table with live web data
Rows in your table are updated with the latest figures from a website or API, so the workbook is current when you open it.
See how it worksGet alerted about rows that need action
You get the rows that match your rule, like students marked absent, with the context you need.
See how it worksGet weekly totals from an Excel tracker
Every Monday you get the totals from your tracker without opening the file.
See how it worksKeep exploring
Set up “Move old rows to an Archive sheet” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.