From the course: Excel VBA: Process Modeling

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adapt the code for multiple runs

Adapt the code for multiple runs

From the course: Excel VBA: Process Modeling

Start my 1-month free trial

Adapt the code for multiple runs

- In the previous movie you ran a simulation that calculated the time a costumer would spend at each station of a sandwich shop. The code we created only allowed for a single run which doesn't provide much helpful information. In this movie I will show you how to add a loop to your simulation code that let's you run multiple simulations so you get more data to analyze. My sample file is Chapter02_08. That's an Excel workbook you can find in the Chapter02 folder of your exercise files collection. We need to make some changes to our workbook, adding information to the sim setup worksheet, and also code within the VBA module. So I'll start in the worksheet. We need to define the number of runs. In other words, the number of times that the simulation will be repeated. So I'll click in cell D2, and type "# of Runs". And I'll the hashtag or number symbol for number. Then I'll click cell A2. Click on the format painter, and…

Contents