From the course: Excel Supply Chain Analysis: Managing Simulations Using VBA

Unlock the full course today

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

Record and run a Solver macro

Record and run a Solver macro

- [Instructor] When I use VBA to manage a solver macro, I like to start by defining the solver model, then saving the workbook and recording the code. You can record the steps establishing the model as part of the macro, but I prefer to have it saved in the workbook itself. After you record the macro, you can run it to see the result. I'll demonstrate how to record and run a solver-based macro in this movie. My sample file's 01_02_RecordMacro. This workbook contains a single worksheet, and on it, I have defined a solver problem. The idea is that I have three cities with demand for a particular product. And you can see those here in column C. It's Portland, Oregon City, and Beaverton. And they are supplied by two suppliers, and those are here under suppliers. We have Milwaukie and Tigard. I have the distances for each of those routes. So you can go from Portland to Milwaukie, or actually, Milwaukie to Portland, Tigard to…

Contents