|
If you want to make your macros interactive then one way of doing this is to introduce message boxes and input boxes. These allow you to display messages that require a response or ask the user to enter values before the macro can proceed any further.
Simple greeting using a message box
Create an empty workbook and the switch to the Visual Basic Editor (VBE) by clicking Tools > Macro > Visual Basic Editor or by using the shortcut key ALT F11. If you are using Excel 2007 click on the Developer ribbon and then click on the Visual Basic Editor button.
Once in the VBE environment you will need to create a module to hold your function. Click Insert > Module In the code window enter the following procedure
Sub Greeting()
MsgBox "Welcome to my spreadsheet"
End Sub
Press F5 to run the macro
|