Skip to main content

Testing the Macro

To test the macro, first select any cells like cell B2, and then use either of the following methods:

Method 1

Press Ctrl+J. Before you recorded this macro, you assigned the macro to the Ctrl+J shortcut key.

Method 2

Click the Macros button in the Code group (or Press Alt+F8 shortcut key)

then select "Helloworld" macro, and click Run.

Method 3

Click the Visual Basic button in the Code group (or Press Alt+F11 shortcut key)

or Right click worksheet sheet1, and then click View Code

then click Run button on the Visual Basic Editor toolbar.

The result

When the macro has finished running, "Hello world" will be entered in cell B2 and formated with underline, italics, and bold.

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>