---
title: "AI Quick Tips 30: Use ChatGPT to create Excel VBA macros"
description: Learn how to create Excel VBA macros using ChatGPT for advanced functionality. Automate tasks and enhance Excel skills with this AI tool.
image: https://thoughtsbrewing.com/hubfs/AI%20Quick%20Tips-1.jpg
---

[![Thoughts Brewing Logo](https://thoughtsbrewing.com/hs-fs/hubfs/Thoughts%20Brewing%20Logo_Round_Final_Light%20Blue_Transparent%20Background-1.png?width=200&height=600&name=Thoughts%20Brewing%20Logo_Round_Final_Light%20Blue_Transparent%20Background-1.png "Thoughts Brewing Logo")](https://www.thoughtsbrewing.com/)

Search toggle

- [Home](https://thoughtsbrewing.com/en-us/home)
- [About](https://thoughtsbrewing.com/en-us/about)
  
  About

    - [About Us](https://thoughtsbrewing.com/en-us/about)
    - [FAQs](https://thoughtsbrewing.com/en-us/faqs)
- [Blog](https://thoughtsbrewing.com/blog)
  
  Blog

    - [Blog Subscription](https://thoughtsbrewing.com/en-us/blog-subscription)
    - [Ask A Question](https://thoughtsbrewing.com/en-us/ask-us-anything-business-tech)
    - [Blog Home](https://thoughtsbrewing.com/blog)
    - [AI Articles](https://thoughtsbrewing.com/blog/tag/ai)
    - [Articles by Damien](https://thoughtsbrewing.com/blog/author/damien)
    - [Articles by Danielle](https://thoughtsbrewing.com/blog/author/danielle)
- [AI Training/Courses](https://thoughtsbrewing.com/en-us/courses)
  
  AI Training/Courses

    - [Next-Level AI Workshops](https://thoughtsbrewing.com/en-us/next-level-ai-workshops)
    - [Free ChatGPT Email Course](https://thoughtsbrewing.com/en-us/chatgpt-kickstarter-email-course)
    - [Request a YouTube Video](https://thoughtsbrewing.com/en-us/youtube-video-request-page)
    - [AI Quick Tips](https://thoughtsbrewing.com/blog/tag/ai-quick-tips)
    - [Writing Style Guide Template](https://thoughtsbrewing.com/en-us/writing-style-guide-template)
    - [Human + AI Playbook Template](https://thoughtsbrewing.com/en-us/human-ai-playbook)
    - [NotebookLM Masterclass](https://maven.com/thoughts-brewing-llc/learn-notebooklm-in-a-weekend-2-cohort)
- [Fractional COO/CTO Services](https://thoughtsbrewing.com/en-us/fractional-coo/cto-services)
- [Contact](https://thoughtsbrewing.com/en-us/contact)

[Contact](https://thoughtsbrewing.com/en-us/contact)

[![Thoughts Brewing Logo](https://thoughtsbrewing.com/hs-fs/hubfs/Thoughts%20Brewing%20Logo_Round_Final_Light%20Blue_Transparent%20Background-1.png?width=200&height=600&name=Thoughts%20Brewing%20Logo_Round_Final_Light%20Blue_Transparent%20Background-1.png "Thoughts Brewing Logo")](https://www.thoughtsbrewing.com/)

- [Home](https://thoughtsbrewing.com/en-us/home)
- [About](https://thoughtsbrewing.com/en-us/about)
  
  About

    - [About Us](https://thoughtsbrewing.com/en-us/about)
    - [FAQs](https://thoughtsbrewing.com/en-us/faqs)
- [Blog](https://thoughtsbrewing.com/blog)
  
  Blog

    - [Blog Subscription](https://thoughtsbrewing.com/en-us/blog-subscription)
    - [Ask A Question](https://thoughtsbrewing.com/en-us/ask-us-anything-business-tech)
    - [Blog Home](https://thoughtsbrewing.com/blog)
    - [AI Articles](https://thoughtsbrewing.com/blog/tag/ai)
    - [Articles by Damien](https://thoughtsbrewing.com/blog/author/damien)
    - [Articles by Danielle](https://thoughtsbrewing.com/blog/author/danielle)
- [AI Training/Courses](https://thoughtsbrewing.com/en-us/courses)
  
  AI Training/Courses

    - [Next-Level AI Workshops](https://thoughtsbrewing.com/en-us/next-level-ai-workshops)
    - [Free ChatGPT Email Course](https://thoughtsbrewing.com/en-us/chatgpt-kickstarter-email-course)
    - [Request a YouTube Video](https://thoughtsbrewing.com/en-us/youtube-video-request-page)
    - [AI Quick Tips](https://thoughtsbrewing.com/blog/tag/ai-quick-tips)
    - [Writing Style Guide Template](https://thoughtsbrewing.com/en-us/writing-style-guide-template)
    - [Human + AI Playbook Template](https://thoughtsbrewing.com/en-us/human-ai-playbook)
    - [NotebookLM Masterclass](https://maven.com/thoughts-brewing-llc/learn-notebooklm-in-a-weekend-2-cohort)
- [Fractional COO/CTO Services](https://thoughtsbrewing.com/en-us/fractional-coo/cto-services)
- [Contact](https://thoughtsbrewing.com/en-us/contact)

[![Thoughts Brewing Logo](https://thoughtsbrewing.com/hs-fs/hubfs/Thoughts%20Brewing%20Logo_Round_Final_Light%20Blue_Transparent%20Background-1.png?width=200&height=600&name=Thoughts%20Brewing%20Logo_Round_Final_Light%20Blue_Transparent%20Background-1.png "Thoughts Brewing Logo")](https://www.thoughtsbrewing.com/)

Search toggle

[Contact](https://thoughtsbrewing.com/en-us/contact)

- [Home](https://thoughtsbrewing.com/en-us/home)
- [About](https://thoughtsbrewing.com/en-us/about)
  
  About

    - [About Us](https://thoughtsbrewing.com/en-us/about)
    - [FAQs](https://thoughtsbrewing.com/en-us/faqs)
- [Blog](https://thoughtsbrewing.com/blog)
  
  Blog

    - [Blog Subscription](https://thoughtsbrewing.com/en-us/blog-subscription)
    - [Ask A Question](https://thoughtsbrewing.com/en-us/ask-us-anything-business-tech)
    - [Blog Home](https://thoughtsbrewing.com/blog)
    - [AI Articles](https://thoughtsbrewing.com/blog/tag/ai)
    - [Articles by Damien](https://thoughtsbrewing.com/blog/author/damien)
    - [Articles by Danielle](https://thoughtsbrewing.com/blog/author/danielle)
- [AI Training/Courses](https://thoughtsbrewing.com/en-us/courses)
  
  AI Training/Courses

    - [Next-Level AI Workshops](https://thoughtsbrewing.com/en-us/next-level-ai-workshops)
    - [Free ChatGPT Email Course](https://thoughtsbrewing.com/en-us/chatgpt-kickstarter-email-course)
    - [Request a YouTube Video](https://thoughtsbrewing.com/en-us/youtube-video-request-page)
    - [AI Quick Tips](https://thoughtsbrewing.com/blog/tag/ai-quick-tips)
    - [Writing Style Guide Template](https://thoughtsbrewing.com/en-us/writing-style-guide-template)
    - [Human + AI Playbook Template](https://thoughtsbrewing.com/en-us/human-ai-playbook)
    - [NotebookLM Masterclass](https://maven.com/thoughts-brewing-llc/learn-notebooklm-in-a-weekend-2-cohort)
- [Fractional COO/CTO Services](https://thoughtsbrewing.com/en-us/fractional-coo/cto-services)
- [Contact](https://thoughtsbrewing.com/en-us/contact)

What are you looking for?

# AI Quick Tips 30: Use ChatGPT to create Excel VBA macros

 July 11, 2024

![Picture of Damien Griffin](https://app.hubspot.com/settings/avatar/20cb51297a34e5d5d7c3362ec1fae755) [Damien Griffin](https://thoughtsbrewing.com/blog/author/damien)

![AI Quick Tips](https://thoughtsbrewing.com/hubfs/AI%20Quick%20Tips-1.jpg)

If you need Microsoft Excel functionality that is not built in then you may be able to use ChatGPT or a similar AI tool to create a VBA macro for you.

This tip is slightly more advanced because it requires a working knowledge of Excel and at least basic programming.  

Excel VBA (Visual Basic for Applications) is a tool used to create custom functions and automate repetitive tasks.  A macro is a set of programming instructions, and in Excel, they are written in VBA.  *(\*Note - there are other options like Python but we’re using VBA here because it is built in)*

I’ll use a really simple example to illustrate this.

If you had all of your sales data in column A of an Excel spreadsheet and you wanted to add all of it up you could create a VBA macro to do it (let’s assume that you don’t know that Excel does this for you already…)

This was my prompt for this example

“Create a Microsoft Excel VBA macro called TotalSales that adds all of the values in column A and formats the sum into currency - dollars to 2 decimal places”

And here’s what I got back

![](https://lh7-us.googleusercontent.com/docsz/AD_4nXfQELtgemdFTxvGRRhB49HPU_E4ajBqlnAX_ZvO4Em05gMJ-bdnzcxYzHlcwdqr2vdZEwEO45egFnVlIbQeT7zEtqU7-6YCLOzssuNzUjeEFT3nQ_1K_ByC-vhAfY3rDQ8xuPCSen_5k4wFbGFKfqe4NVM3?key=-LHyRR2fXBg_OdTvvygjmg)![](https://lh7-us.googleusercontent.com/docsz/AD_4nXdeMSRtr-Wd613DNrtTffU6A1hIoVIIiovMa9uNv899hokMvfpF4iTBYZxLQMl24-Ov4dwwdCARF1_noaSjwcOFYFF8ZhlgzLqfZlbkK-4V9Re9lefzE5uYBhxbk5rO2qEcUGs1fswiOpxI1ogMjfTGWzD7?key=-LHyRR2fXBg_OdTvvygjmg)

Then, under the macro, it told me how to use it

![](https://lh7-us.googleusercontent.com/docsz/AD_4nXdfswwL6Z1wsLAzdPBqduF9J-jkRbiSvIWJT_EMeorQN9BxVk1PcPoST4ueMmY0XbLtt2DyGLoohgWJhaQgRfzhr9IkO6rdaVX9GpmG25QSbtJ8-P9Hs8H637-joKNiHafYH2f3r9yhaT6G9bqsBqIALCuW?key=-LHyRR2fXBg_OdTvvygjmg)

Basic programming knowledge helps here because AI tools make mistakes and there is nothing saying that its code will be flawless (it won’t be…)  It will be easier for you to find what’s wrong and fix it if you know what you are looking at.

If you have a Microsoft Office 365 plan with Copilot that would probably be a better choice since it is already integrated with Excel.  I didn’t use that here because I wanted to show how you could do it without access to that paid tool.

### Share:

[Share on Facebook](http://www.facebook.com/share.php?u=https://thoughtsbrewing.com/blog/ai-quick-tips-use-chatgpt-to-create-excel-vba-macros&utm_medium=social&utm_source=facebook) [Share on LinkedIn](http://www.linkedin.com/shareArticle?mini=true&url=https://thoughtsbrewing.com/blog/ai-quick-tips-use-chatgpt-to-create-excel-vba-macros&utm_medium=social&utm_source=linkedin) [Share on X](https://twitter.com/intent/tweet?original_referer=https://thoughtsbrewing.com/blog/ai-quick-tips-use-chatgpt-to-create-excel-vba-macros&utm_medium=social&utm_source=twitter&url=https://thoughtsbrewing.com/blog/ai-quick-tips-use-chatgpt-to-create-excel-vba-macros&utm_medium=social&utm_source=twitter&source=tweetbutton&text=AI%20Quick%20Tips%2030:%20Use%20ChatGPT%20to%20create%20Excel%20VBA%20macros)

[AI Quick Tips](https://thoughtsbrewing.com/blog/tag/ai-quick-tips), [AI](https://thoughtsbrewing.com/blog/tag/ai), [Prompt Engineering](https://thoughtsbrewing.com/blog/tag/prompt-engineering), [Advanced](https://thoughtsbrewing.com/blog/tag/advanced), [Excel](https://thoughtsbrewing.com/blog/tag/excel), [Microsoft](https://thoughtsbrewing.com/blog/tag/microsoft), [Copilot](https://thoughtsbrewing.com/blog/tag/copilot)

## Comments

## Related posts

##### Menu

- [Home](https://thoughtsbrewing.com/en-us/home)
- [About](https://thoughtsbrewing.com/en-us/about)
- [Blog](https://thoughtsbrewing.com/blog)
- [AI Training/Courses](https://thoughtsbrewing.com/en-us/courses)
- [Fractional COO/CTO Services](https://thoughtsbrewing.com/en-us/fractional-coo/cto-services)
- [Contact](https://thoughtsbrewing.com/en-us/contact)

[Privacy Policy](https://thoughtsbrewing.com/en-us/privacy-policy)   |  [Terms of Use](https://thoughtsbrewing.com/en-us/terms-of-use)    |   Herndon, VA   |   703-296-9912   |   ©2022-2026 Copyright Thoughts Brewing, LLC

[Follow us on LinkedIn](https://www.linkedin.com/company/thoughts-brewing-llc) [Follow us on Facebook](https://www.youtube.com/@thoughtsbrewingllc) [Find us on Google](https://g.co/kgs/YhpnVFp) [Find us on Yelp](https://www.yelp.com/biz/thoughts-brewing-herndon) [Follow us on Facebook](https://www.facebook.com/thoughtsbrewingllc)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Damien Griffin",
    "url" : "https://thoughtsbrewing.com/blog/author/damien"
  },
  "dateModified" : "2025-05-29T15:56:49.334Z",
  "datePublished" : "2024-07-11T12:45:00.000Z",
  "headline" : "AI Quick Tips 30: Use ChatGPT to create Excel VBA macros",
  "image" : [ "https://thoughtsbrewing.com/hubfs/AI%20Quick%20Tips-1.jpg" ],
  "mainEntityOfPage" : {
    "@id" : "https://thoughtsbrewing.com/blog/ai-quick-tips-use-chatgpt-to-create-excel-vba-macros",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://thoughtsbrewing.com/hubfs/Thoughts%20Brewing%20Logo_Round_Final_Light%20Blue_Transparent%20Background-1.png"
    },
    "name" : "Thoughts Brewing, LLC"
  }
}
```

```json
{
  "@context" : "http://schema.org",
  "@type" : "Organization",
  "address" : {
    "@type" : "PostalAddress",
    "addressCountry" : "United States of America",
    "addressLocality" : "Herndon",
    "addressRegion" : "Virginia",
    "postalCode" : "20170",
    "streetAddress" : "205 Van Buren Street, Suite 120"
  },
  "email" : "contact@thoughtsbrewing.com",
  "logo" : {
    "@type" : "ImageObject",
    "url" : "https://24461783.fs1.hubspotusercontent-na1.net/hubfs/24461783/Thoughts%20Brewing%20Logo_Round_Final_Light%20Blue_Transparent%20Background-1.png"
  },
  "name" : "Thoughts Brewing, LLC",
  "telephone" : "703-296-9912",
  "url" : "thoughtsbrewing.com"
}
```

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "abstract" : "Learn how to create Excel VBA macros using ChatGPT for advanced functionality. Automate tasks and enhance Excel skills with this AI tool.",
  "author" : {
    "@type" : "Person",
    "name" : "Damien Griffin"
  },
  "dateModified" : "29 May 2025, 15:56",
  "datePublished" : "2024-07-11 12:45:00",
  "headline" : "AI Quick Tips 30: Use ChatGPT to create Excel VBA macros",
  "image" : "https://24461783.fs1.hubspotusercontent-na1.net/hubfs/24461783/AI%20Quick%20Tips-1.jpg",
  "inLanguage" : "en",
  "keywords" : "[AI Quick Tips, AI, Prompt Engineering, Advanced, Excel, Microsoft, Copilot]",
  "mainEntityOfPage" : {
    "@type" : "WebPage"
  },
  "name" : "AI Quick Tips 30: Use ChatGPT to create Excel VBA macros",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://24461783.fs1.hubspotusercontent-na1.net/hubfs/24461783/Thoughts%20Brewing%20Logo_Round_Final_Light%20Blue_Transparent%20Background-1.png"
    },
    "name" : "Thoughts Brewing, LLC"
  },
  "text" : "If you need Microsoft Excel functionality that is not built in then you may be able to use ChatGPT or a similar AI tool to create a VBA macro for you. This tip is slightly more advanced because it requires a working knowledge of Excel and at least basic programming. Excel VBA (Visual Basic for Applications) is a tool used to create custom functions and automate repetitive tasks. A macro is a set of programming instructions, and in Excel, they are written in VBA. (*Note - there are other options like Python but we’re using VBA here because it is built in) I’ll use a really simple example to illustrate this. If you had all of your sales data in column A of an Excel spreadsheet and you wanted to add all of it up you could create a VBA macro to do it (let’s assume that you don’t know that Excel does this for you already…) This was my prompt for this example “Create a Microsoft Excel VBA macro called TotalSales that adds all of the values in column A and formats the sum into currency - dollars to 2 decimal places” And here’s what I got back Then, under the macro, it told me how to use it Basic programming knowledge helps here because AI tools make mistakes and there is nothing saying that its code will be flawless (it won’t be…) It will be easier for you to find what’s wrong and fix it if you know what you are looking at. If you have a Microsoft Office 365 plan with Copilot that would probably be a better choice since it is already integrated with Excel. I didn’t use that here because I wanted to show how you could do it without access to that paid tool.",
  "url" : "https://thoughtsbrewing.com/blog/ai-quick-tips-use-chatgpt-to-create-excel-vba-macros"
}
```