|
Perhaps the most useful technique for launching your VBA code from within Excel
is to embed a "Start" button directly in your worksheet:

In Excel 2007 this is done with the Insert command on the Developer tab in the
Ribbon:

In Excel 2003, make sure the Control Toolbox is open by selecting it from the
View - Toolbars dropdown menu:

Then select the Command Button from the Control Toolbox:

In both Excel 2007 and Excel 2003, the next step is to drawn the button on your
worksheet by dragging with your mouse. In Excel 2007, the Assign Macro
dialogue opens automatically after you have drawn the button. In this case
you can assign your Monte Carlo function name directly to the button without
having to create a subroutine which calls the function.

In Excel 2003, double clicking the button while it is in Edit mode will open the
VB Editor displaying a new subroutine associated with the button. Type the
name of your Monte Carlo function in the subroutine, then save the file.

The downloadable Examples
worksheets contain embedded "start" buttons for each included VBA function.

|