How to Create Excel Automation Macros with ChatGPT (Even Beginners Can Do It)

At work, I had repetitive Excel tasks every day (data cleaning, creating pivot tables, updating charts), so I asked ChatGPT to write VBA macros for me.

The method is simple. 1) Describe the task you want in natural language (e.g., "Filter data based on dates in column A, and create a pivot table with the sums of columns B to D on a new sheet") 2) Paste the VBA code generated by ChatGPT into the Excel VBA editor 3) Run it—done.

At first, the code sometimes had errors, but copying the error message and asking again fixed it. Now, tasks that used to take 30 minutes are done in 1 minute, which is incredibly convenient.

If you have any other automation tips, please share!

by 프롬프트장인64

6 answers

I'm using it similarly, and when I tell ChatGPT 'add error handling to this code,' it runs more reliably. It's especially useful when dealing with large amounts of data.

by 스타트업러96 · ▲0

Wow, this is a real game-changer! I've been manually filtering every day, so I need to try this out. By the way, what's the best way to describe how to create a pivot table to ChatGPT for the most accurate results?

by 문과출신개발자68 · ▲0

I once struggled with date formatting while writing a macro in ChatGPT, but when I copied the error message and asked about it, it fixed it right away. It's truly a handy assistant.

by 무한도전러513 · ▲0

I also use Power Query alongside it, and ChatGPT supports M language as well. If you automate data import and transformation, there's almost nothing left to do manually. Give it a try.

by 프롬프트장인400 · ▲0

ChatGPT is really convenient for writing VBA. I asked for 'code to merge multiple sheets into one,' and at first it was slow, but when I said 'use arrays,' the speed improved dramatically. Thanks for the tip!

by 데이터덕후666 · ▲0

Oh... 30 minutes feeling like 1 minute, that's enviable. I'm still a beginner and sometimes can't even understand error messages, but it gives me hope that if I keep asking, I'll get answers. Let's both hang in there!

by 무한도전러268 · ▲0