Have you ever wanted to generate AI-driven answers directly within Excel on your Mac?
A viewer recently asked if there’s a way to send prompts from Excel for Mac to an AI program? In this video, I demonstrate a practical and budget-friendly method to make this happen!
The Demo
In the demo I type the questions (AI Prompts) into a range of cells down column and click a button which sends the questions to ChatGPT. ChatGPT sends the answers back to Excel and the answers are then displayed in column B.

The process is driven by VBA and in the video I talk through the VBA code.
Although this can also be achieved in Excel for Windows, the VBA code would be slightly different.
API Keys
If you want to do this you will need an “OpenAI API Key”. An API key is a unique string of randomly generated characters. Any time you want to access OpenAI’s models – and that includes ChatGPT, from another application, and that’s what I’m doing, accessing ChatGPT via Excel, you’ll need to store your API key in the application that is accessing OpenAI. In my case, it’s part of the VBA code.
To get an API key you need to go to the API Keys page on openai.com
- Go to openai.com and click Products at the top of the screen
- Click API Login
- If you have an OpenAI or ChatGPT account, sign in
- If not you can sign up for a free account
- Once you are logged in click the cog at the top of the screen
- Click API Keys on the left hand side
- Click Create a New secret Key
- Click Create Secret Key
- A unique API key will be displayed. You need to copy it and store it securely as you will then need to paste it into the VBA code in Excel
It’s also important to note that while creating an account and generating an API Key are free, there is a very small cost if you want to use the API. How that works is that you pre–pay by adding credits to your account via the Billing section on openai.com and then openAI charge you on a pay-as-you-use basis.
The pricing model is quite confusing but in essence using short prompts like the ones I used in my demos would cost a fraction of a penny. My understanding is that you can still pay for API credits even if you are on the free ChatGPT plan.
Download a copy of the file used in this video: https://share.zight.com/bLuv9x5q