1. First step, open your visual basic editor by clicking Tools -> Macro -> Visual Basic Editor

2. Click Insert menu, and then select Module to open module window.

3. In the module window type following code:
Sub showHello()
MsgBox "I Love Excel!"
End Sub

4. To run your first macro, click Run -> Run Sub/UserForm or by pressing [F5] key.

5. "I Love Excel!" message box will appear in your screen.
No comments:
Post a Comment