Skip to Content

How to use AI with Excel without typing formula

ChatGPT Prompt Structure

"Write an Excel VBA macro to [goal]. My data starts at line X up to line X (counting the headers) in the following order:

[Paste your headers]

The name of the sheet is [name]."

Example

"Write an Excel VBA macro to sort athletes by increasing age and create a bar chart: Athletes' Weight vs Sport. My data starts at line 3 up to line 376 (counting the headers) in the following order:

Name Sport Nationality Age Wt kg Ht

The name of the sheet is Sheet1."

ChatGPT will provide an Excel macro ready to use.

Steps

  1. Click “Copy code” to get the macro.
  2. Open Excel and go to the Developer tab. If it’s not visible, right-click the ribbon > Customize the Ribbon > Check Developer.
  3. Click on Macros, enter a name, and click Create.
  4. In the window, paste the VBA code provided by ChatGPT and run it using the play button at the top.

How to use AI with Excel without typing formula