This example resets the simulation, defines cell B5 as the target forecast with cells C1 and C2 as the first and second decision variables. Then, it specifies the number of test values to use for each of the two decision variables (7 and 10, respectively), sets 500 as the maximum number of trials to run, and indicates that forecast charts are to be hidden while the simulation is running. The final line runs the tool.
CB.ResetND 'Select a target forecast: Range("B5").Select CB.DecisionTableND cbDecChooseTarget 'Clear the list of any previously selected decision variables CB.DecisionTableND cbDecChooseDecVar, cbChdClearList 'Select decision variables (cells C1 and C2) Range("C1").Select CB.DecisionTableND cbDecChooseDecVar, cbChdAdd Range("C2").Select CB.DecisionTableND cbDecChooseDecVar, cbChdAdd 'Set number of values to test for DecVar1 (in cell C1) CB.DecisionTableND cbDecSimOption, cbDecNumValuesVar1, 7 'Set number of values to test for DecVar2 (in cell C2) CB.DecisionTableND cbDecSimOption, cbDecNumValuesVar2, 10 'Set maximum number of trials per simulation CB.DecisionTableND cbDecSimOption, cbDecSimTrials, 500 'Hide forecast chart windows during simulation CB.DecisionTableND cbDecForeOption, cbDecHideFore 'Run the Decision Table tool CB.DecisionTableND cbDecRun