Solving Linear Programs in a Loop by Automating Excel Solver
Kingsley Gnanendran and Ozgur Isil
Arthur J. Kania School of Management, The University of Scranton, USA
Volume 19: 2025, pp. 161-178; ABSTRACT
This paper presents an efficient method that instructors can use to demonstrate how
to solve a series of related linear programs in a loop by automating the native Excel Solver using
VBA (Visual Basic for Applications), the built-in programming environment in Microsoft
Office. The approach is illustrated on two elementary linear programming models, the product
mix problem (maximization objective) and the transportation problem (minimization objective),
but this automation approach can easily be applied to any linear programming model to examine
the impact of arbitrary changes in any of the model’s input parameters (e.g., a right-hand side
value or objective function coefficient). VBA offers students several advantages over invoking
Solver via the standard Excel interface. It provides a customizable sensitivity analysis that goes
beyond the fixed parameter limits in the Sensitivity Report. It requires very little coding, so no
prior programming background would be expected; on the contrary, it can act as a gentle
introduction to increasingly indispensable programming languages.
Keywords: Linear Programming, Sensitivity Analysis, Excel, VBA, Solver Automation.
ORDER ARTICLE PERMISSIONS/REPRINTS/OFFPRINTS
To order permissions to include this article in textbooks, edited volumes, course booklets, online/digital course packs, etc., and/or to order multiple individual hard copies for classroom use, please use the appropriate form available on the Order Forms page or alternatively, contact the Publishing Editor pneilson@neilsonjournals.com directly.