1. Learn VBA - Introduction to VBA Editor

Nick's picture

Excel 2007:

Lesson 1 will teach you how to attach some code to a button that will bring up a message box that says Hello!.

Step1:
Make sure your excel options (Office button in top left => Excel Options) are as shown:
Data

Step2:
Click Developer ribbon, Insert => choose the first button under "Form Controls".
Click and hold anywhere on your worksheet. Now drag the mouse down and across slightly. This will create the button. The further you drag, the bigger the button.

Step3:
When the following box pops up, type: myMessageBox in the macro name field.
Data
Now press NEW

Step4:
You will now see a sub routine has been created for you, and you can type the following in the space provided:
MsgBox "Hello!"
Data

Now press ALT + F11 to return to your sheet, and press the button.

Congratulations on writing your first VBA program !

Excel 2003:
Right click on an empty space on the toolbar, and choose FORMS.
...goto Step2 and continue.

Download Practise Sheet

Introduction to VBA Editor - Training Video

NimaIranian's picture

class not registered while trying to access to custom property

hi all experts,

In Excel VBA UserForm,when i trying to access custom property of controls i get error that Class Not registered.

even i tried below links but my problem is still alive:

http://support.microsoft.com/kb/182500

http://support.microsoft.com/kb/188331

pls help me sort out this error.