From the course: Excel Copilot: Building and Maintaining VBA Macros

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

VBA debugging techniques with Copilot

VBA debugging techniques with Copilot

- [Instructor] You've probably encountered situations where even the best macros can break, whether due to unforeseen data issues or an edge case your coworkers unexpectedly discover. Thankfully, Copilot isn't just great for writing macros. It's also a fantastic partner in debugging them. The workbook for this exercise is debugging macros, and in this scenario, we're working with a dataset containing employee details. The data has common issues, such as non-numeric salaries and invalid dates. The existing macro attempts to highlight salaries below $60,000 and bold start dates before 2022, but it's currently throwing a tight mismatch error. I'm going to go ahead and run this macro to see what we're up against. So here's our clean employee data macro. We'll run this and you'll see, as expected, that we do get a tight mismatch error here. So this is where some old school note-taking will help. There's no way unfortunately to…

Contents