Updating My Year in Pixels Excel Template with OpenAI’s ChatGPT

Lately, there has been a surge of TikTok videos discussing an intriguing new AI program called ChatGPT. Some claim that it has the potential to replace Google search in the future. However, what truly caught my attention was a demo showcasing ChatGPT’s ability to write VBA macros for Microsoft Excel. Naturally, I became curious and decided to give it a try myself.

Back in 2018, I created an Excel template called “Year in Pixels” to monitor my daily mood. While I haven’t updated it recently, I’ve received new comments and questions about how to use and customize the spreadsheet. With the beginning of a new year, I thought it would be the perfect time to enhance the template and introduce some fresh features. This led me to a brilliant idea – why not utilize this opportunity to update my mood tracking Excel template using ChatGPT? Let’s dive in and see how it goes!

Achieving Conditional Formatting: Updating Cell Fill Colors Based on Another Cell’s Color

Recently, a user posed a question that got me thinking: “How can I easily change the colors in my Year in Pixels sheet?” While seasoned Excel users might recognize that the colors are applied through conditional formatting formula rules, it’s not immediately apparent to those who are less familiar with Excel. Consequently, there should be a simpler way to modify the colors. Unfortunately, in my current Excel version, there isn’t a direct method, or at least not an easy one, to have the fill color in conditional formatting reference the color of another cell.

Nevertheless, I’ve come up with a workaround solution. I’ll create a macro that can update the conditional formatting rules with just a button click. This will streamline the process and eliminate the need for manual adjustments. Now, let’s turn to ChatGPT and delve into the

How does ChatGPT (Generative Pre-trained Transformer) work?

ChatGPT is a variant of the GPT language model developed by OpenAI. GPT is based on a transformer neural network architecture and is trained on a large corpus of text to generate coherent and contextually relevant text. ChatGPT, specifically, is fine-tuned to engage in conversations with humans.

During the fine-tuning process, ChatGPT is trained on a vast dataset of conversation data. It learns to predict the next word in a conversation based on the preceding words. When you provide a message to ChatGPT, it leverages its understanding of language and conversational patterns to generate a response. By predicting the next word in the conversation based on the input and the existing context, ChatGPT generates a response that aims to be coherent and relevant.

However, it’s important to note that ChatGPT is not infallible. OpenAI acknowledges its limitations, which are listed on the main page. It may occasionally produce incorrect information or even provide harmful instructions. For instance, asking for a list of the ten tallest roller coasters in the world might yield an incorrect or nonsensical response, as ChatGPT’s responses are generated based on statistical patterns rather than verified facts.

Thus, while ChatGPT is a powerful tool for generating text, it’s crucial to exercise caution and verify the information it provides, especially when factual accuracy is paramount.

Creating Custom VBA Macros Automatically with ChatGPT

I wasn’t sure how specific I needed to be so I decided to err on the side of caution, plus I thought the more detailed I am the less modification I’ll probably need to do later. Now I ask ChatGPT: “create a vba macro to make a new conditional formatting rule where range is C4 to N34, if cell value = 5 then change the fill color to the same color as in cell P12.” Then it began typing and my jaw dropped.

I copied and pasted the code into Excel VBA editor and it worked! One thing I forgot is this macro will just add new rules applied to the same range. I need to delete all the existing formatting rules before adding new ones, so I ask ChapGPT:

I added the above code to the earlier response and linked it to a newly added button on my sheet. Now a user can change the fill color of a cell, click the button, and the fill colors update automatically to match.

If you want to see all this play out in real time, watch the video I recorded below:

Thoughts on the Future of ChatGPT

It’s awesome that it doesn’t just spit out the code, but it also suggests how you might need to modify it AND tells you how to run the macro as well. Even though I’ve only asked it to make simple macros, I already see how this program could save a lot of time.

I’m not done experimenting but so far ChatGPT seems like a much better option over Recoding macros or Google searches that might take you a few tries to find exactly what you’re looking for. Especially when you can get custom code on the fly. On one hand, I feel a little obsolete, but on the other I also don’t think ChatGPT will completely be replacing programmers just yet as you can see I still had to understand the code and modify it to fit my exact needs.

Download my Year in Pixels template for free here and try it for yourself. Open the macro editor to view the final codes written by ChatGPT. https://dsadsadsadsadsa.gumroad.com/l/year-in-pixels

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Basket
Scroll to Top