From the course: Excel VBA: Process Modeling

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Adapt the code for multiple runs

Adapt the code for multiple runs - Microsoft Excel Tutorial

From the course: Excel VBA: Process Modeling

Adapt the code for multiple runs

- [Instructor] In the previous movie, we ran a simulation that calculated the time a customer would spend at each station of a sandwich shop. The code we created only allowed for a single run, and even though we ran it multiple times by ourselves, it's much easier to do that in code. So in this movie, I will show you how to add a loop to your simulation code that lets you run multiple simulations so you get more data to analyze. My sample file is chapter 0208, and you can find it in the chapter two folder of the exercise files collection. I want to make the number of runs easily visible for anyone who uses the workbook, so I'm going to put the number of runs in the Sim Setup worksheet. So in cell D2, I will type a label for the number of runs. So I'll do a hashtag for number of runs, then I'll click A2. Then on the home tab of the ribbon, click the format painter button and then click D2. Then in cell E2 I will type in the number of runs and I'll just do two, that will make sure that…

Contents