Boost your Excel game with ready-to-use ChatGPT VBA prompts for automating tasks, writing macros, and saving hours of manual work.
If you’re working with Excel, Access, or any Microsoft Office app, VBA (Visual Basic for Applications) can be your automation superpower. But writing the perfect macro or script from scratch? That’s where it gets tricky. With the right ChatGPT VBA prompts, you can automate repetitive tasks, debug existing code, and even generate fully functional macros in seconds. Whether you’re an Excel analyst, finance pro, or developer, this prompt library helps you save time, reduce errors, and scale productivity—all powered by AI.
Act as a professional VBA macro developer. I want you to write a fully functional macro in VBA for Excel based on my requirements. Follow these instructions:
- Ask me what version of Excel I'm using
- Use clean and well-commented code
- Explain the macro line-by-line in plain English
- Highlight any security or permission settings required
- Suggest improvements or alternatives if needed
Requirement: [Insert task, e.g., “Create a macro to auto-sort data in Sheet1 by Column B whenever new data is added.”]
Convert the following repetitive Excel task into a fully optimized VBA script. Include error handling and user prompts where necessary.
Task: [Describe task, e.g., “Copy all rows from Sheet1 to Sheet2 if column C = ‘Done’”]
Make sure to:
- Use proper variable naming
- Add comments for each step
- Provide a version for Excel 2016 and above
Act as an expert VBA debugger. I will paste my VBA code, and I want you to:
- Identify syntax or logical errors
- Suggest optimized alternatives
- Add comments for clarity
- Explain what each block does
- Tell me how to test and validate the fixed code
Here's my code:
[Paste VBA code here]
Act as a VBA UserForm generator. Create a VBA UserForm with the following features:
- Input fields: [List fields, e.g., Name, Age, Email]
- Buttons: Submit, Reset, Exit
- Actions: On Submit, save data to Sheet1 in the next empty row
- Design layout to be user-friendly and responsive
Also provide:
- Complete VBA code for the form
- Instructions to insert and activate it in Excel
I need a VBA script that uses loops and conditional logic. Write a macro that:
- Loops through rows 2 to 100 in Sheet1
- If Column B contains "Overdue", highlight the entire row in red
- If Column B contains "Completed", mark the cell in green
- Exit loop if an empty cell is found in Column A
Include detailed comments and performance optimizations.
Act as a VBA developer for Outlook automation. Write a macro that:
- Reads email addresses from Column A in Sheet1
- Composes a custom message using data from Column B
- Sends personalized emails via Outlook
- Logs success/failure status in Column C
Ensure the code handles:
- Missing email addresses
- Outlook permission prompts
- Rate limiting and delays between sends
I want to convert my VBA code to Python for Excel automation using `openpyxl` or `pandas`. Please:
- Analyze my VBA code
- Rebuild its functionality using Python
- Optimize for performance and readability
- Explain differences in logic and syntax
Here's the VBA code:
[Paste code here]
Create a VBA script that:
- Prompts the user to select a file using FileDialog
- Reads content only if it’s a `.csv` or `.xlsx`
- Validates file type before reading
- Handles errors if the file is open, locked, or missing
Also include:
- Comments on improving security
- Option to cancel and restart the process
Act as a VBA developer for dynamic Excel dashboards. I want to create an interactive dashboard using VBA that:
- Automatically updates charts based on dropdown selection
- Uses buttons to refresh data or navigate sheets
- Includes summary metrics and colored indicators
- Is compatible with Excel 2016 and newer
Generate the full code and instructions for setting it up.
Act as a code performance expert. I have old VBA code written in Excel 2010. Optimize it by:
- Removing redundant variables
- Using faster methods (like arrays or With blocks)
- Adding `Option Explicit` and proper error handling
- Suggesting modern replacements if applicable
Paste your legacy code below:
[Insert code]
Start automating Excel with AI—copy, paste, and run these VBA prompts in ChatGPT now.
👉 Bookmark this page, your future self will thank you!
Subscribe & get free email of top 5 AI tools, prompts, and hacks
Includes: $99 Worth Templates of Task Manager, Goal Tracker & AI Prompt Starter Pack
We respect your privacy. No spam, unsubscribe anytime.