Tag Archives: VBA

Processing blood inventory simulation data with VBA

In the project Improving Blood Inventory Management through Simulation the goal was to develop an inventory management model to explore new policies for hospitals in BC. The model developed simulates how blood inventory is managed in BC hospitals and is implemented in an excel workbook that uses VBA code to run a number of trials simulating the daily operations in a network of hospitals.

One of the challenges faced was how to generate and handle inventory data from multiple hospitals, days and simulation replications. The approach was to structure the tool as a decision support system, with the simulation model running separately from the user interface. Blood supply and demand distributions inputs we read values from an Excel spreadsheet. Daily values were generated using the built in Excel functions, and for a triangular distribution we created our own function. Global variables were used to store parameters used across multiple hospitals and dynamic arrays were used to record the hospital inventory levels, consolidate replication outputs and calculate network metrics.