From the course: Microsoft Copilot for Excel
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Creating VBA macros
From the course: Microsoft Copilot for Excel
Creating VBA macros
- [Professor] For this next demo, we'll be using copilot to help us create and run a macro to automate a task in Excel. And as you may have guessed, we'll be using the VBA macros tab in this workbook. So, right now we've got a table with product orders here on the left and on the right we have a product summary by month. So, we can use this drop down here to switch between different months and then the average quantity and the average revenue will update for each product. Problem, as you may have seen, is that we're getting a div zero error for products that didn't have any orders in that particular month. So, what we can do is simply wrap this in an if error statement, apply it across, apply it down, and then call it a day. But maybe this is something that we find ourselves doing over and over since it's not really intuitive to start all of your formulas with if error. But what we can do then is write a macro that looks for all the formulas in our worksheet and then wraps them in an…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.