Below shows the typical, basic procedure to create a macro and assign it to a
button.
1) From the Tools menu, choose VBA Editor.
2) In the Project Explorer, locate a file you're working on, right-click the
VBAProject of that workbook, choose insert, then choose module.
3) In the new blank screen of the module which appeared, type a macro. e.g.
Sub hello()
Msgbox "hello world!"
End Sub
4) Close the window of the VBA Editor (go back to the spreadsheet)
5) From the View menu, choose Toolbars, then choose Forms.
6) Click the icon which represents a "Button" control. Place a button on the
worksheet.
7) You'll be asked to assign a macro to the button. Choose the macro you
just created. Click OK to finish.
If you want to learn more about this, I would recommend reading a book (e.g.
a "Step-by-Step" book from Microsoft Press on the Excel VBA topic.
Regards,
Edwin Tam
(e-mail address removed)
http://www.vonixx.com