Take note

Throughout the book, you may find that the items displayed on your system do not accord exactly with the screenshots. Don't panic if this is the case. It might be due to some interface modification in your version of Excel or other reasons.

From Excel, start the macro recorder by selecting the Tools menu, then selecting Macro, followed by the Record New Macro option (see Figure 2.2). In future, Excel commands like this will be written in following shorthand format: Tools > Macro > Record New Macro.

® Microsoft EKCe! - SALESMAN

File Edit View Insert Format

Workbook Name: WorkJteet .V'.;t:e ; System Purpose:

¡SALESMAN weeklysales To maint.am w to calculate sa for eachrepre

Tools Data Window Help

Typi y Spelling... F7

Error Checking...

Share Workbook...


Online Collaboration mk Data

Formula Auditing


End of Month Sales: | Each c ell value Monthly Bonus : Sales To Date: Month No:

mWsTs"WctMfecfTjy"acfcfiiij Each cell value in this is calculate d by mulnp Each c ell in this range is c arrie d over from th( -This cell value is incremented at the start of each new month b i u m m =

Click Record New Macro t Macros... I" ┬╗ Record New Macro...

Visual Basic Editor Alt+Fl

Microsoft Script Editor Alt+Shift+Fl

Figure 2.2 Selecting Record Macro from the Excel menu

The dialog box as shown in Figure 2.3 will appear. You should then enter a name for the new macro. Enter the name: updateSalesRep. Note also that you are invited to type in a description of what the macro does. It is customary to write the name of the person who wrote the macro, the date it was written, and the version number to facilitate future maintenance. From this dialog box you decide where the macro is to be stored by using the Store macro in drop-down list. If This Workbook is selected, then the macro will be stored in the current workbook only. If you select the option Personal Macro Workbook from the list, this has the effect of creating a global macro: meaning that it will be available to all workbooks created in Excel. Beware

Take your time when recording a macro. Remember, the macro recorder does not record the delay between actions, but every keystroke is recorded - mistakes as well!

of saving a macro in the Personal Macro Workbook format because of the extra memory consumed. The Shortcut key box can be used to assign a keyboard shortcut to a macro, bear in mind however, that many of the [Ctrl] key combinations are already in use by the Excel system. Click OK when complete to start recording. The Record Macro Toolbar appears on the worksheet and the message 'Recording' will be visible in the bottom left hand side of the Status Bar.

Macro name:


Store macro in:


Wacro recorded 26/07/2003 by Keith


Enter recorded macro name here

Description box contents will be displayed as comments

Record Macro

Shortcut key box

| This Workbook

Store options

Figure 2.3 The Record Macro dialog box

0 0

Post a comment