/macro

Drafts a simple script to automate a repeated spreadsheet task.

The full prompt

/macro Write a simple script for [Excel VBA or Google Sheets Apps Script]. The task I repeat: [steps]. When it should run: [on a button, on edit, daily]. Give the full code with short comments, step-by-step instructions to install and run it, and any permissions it will ask for. Ask me first if anything is unclear.

Replace the highlighted [brackets] with your own details, then send.

What you're asking

You ask the AI to draft automation code for your spreadsheet. You get commented code plus install and run steps.

Give it

  • Excel VBA or Google Sheets Apps Script
  • The exact steps you repeat
  • When it should run

Check: Test on a copy first, and check your workplace allows scripts before running code on work files.

Filled-in example

/macro Write a simple script for Google Sheets Apps Script. The task I repeat: check column D every morning and email me at my work address a list of rows that say "Overdue". When it should run: daily at 8 am. Give the full code with short comments, step-by-step instructions to install and run it, and any permissions it will ask for. Ask me first if anything is unclear.

Use it in any AI chat. The slash word is a label, not a built-in command; the prompt does the work, and answers vary by app. How these work