Executing the Sub procedure directly

The quickest way to execute this procedure is by doing so directly from the VBA module in which you defined it. Follow these steps:

1. Activate the VBE and select the VBA module that contains the procedure.

2. Move the cursor anywhere in the procedure's code.

3. Press F5 (or choose RunORun Sub/UserForm).

4. Respond to the input box and click OK.

The procedure displays the cube root of the number you entered.

You can't use the RunORun Sub/UserForm command to execute a Sub procedure that uses arguments because you have no way to pass the arguments to the procedure. If the procedure contains one or more arguments, the only way to execute it is to call it from another procedure — which must supply the argument(s).

0 0

Post a comment