Executing Sub procedures from the Macro dialog box
This recipe will show us how to execute a Sub procedure from within Excel. Once again, there is no right or wrong, no better or faster method; it is just another way of getting the macro to do what it is supposed to do.
Getting ready
If you are not already in Sheet1, press Alt + F11 to switch back from the code window to Excel and clear cells A1, B1, and C1.
How to do it…
To run the macro from the Macro dialog box, do the following:
- Click Developer | Code | Macros to activate the Macro dialog box:
- The only available macro is the one you've just created:
TableData
. Click on Run. - As per the coding instructions for the Sub procedure, you will find the text inserted into cells A1, B1, and C1. Cell D1 will be selected, yet empty.
How it works…
We executed exactly the same Sub procedure as before. The only difference is the method: instead of...