7.141 bytes

Service Hints & Tips

Document ID: MCGN-3G8L2Y

Aptiva - Information On Using Macros In A Works Spreadsheet.

Applicable to: United States

Use a macro to simplify entering spreadsheet functions!

Although Works comes with more than 50 built-in spreadsheet functions, you probably find that you use only a handful of them on a regular basis. Inserting the functions manually in each cell can be a tedious operation since you must alternate alphabetic characters with shifted special characters such as the open and close parentheses. If you find that you're consistently using the same functions, you might want to apply a macro technique to insert them automatically into your spreadsheets. With this technique you can record your most frequently used spreadsheet functions in macros. Then press a macro playback key to insert a particular function automatically into a cell.

MACRO BASICS

To record a macro, you press [Alt]/ to display the Macro options dialog box, then select the Record Macro command. Next, Works displays a dialog box asking you to select a key or key combination that you'll use to play the macro. Works also offers the option of giving the macro a descriptive title. After entering a keystroke and title, you choose the dialog box's <OK> button, then enter the keystrokes for the macro. (You should not use the mouse to select functions -- only use the keyboard.) After you have entered all the keystrokes you want included in the macro, you press [Alt]/ again. When you do, Works will display a slightly different Macro options dialog box. You then choose End Recording to stop recording keystrokes.

After you record a macro, you can play it by pressing the key or key combination to which you've linked the macro. If you want to cancel the playing of a macro before it has finished, press [Alt]/. When you do this, Works will stop executing the macro, and your screen will reflect any changes the macro has made to that point.

RECORDING ONE OF THE MOST COMMONLY USED FUNCTIONS

Now that we've discussed the basics needed for creating a macro, let's record a macro that uses one of the most commonly used spreadsheet functions, SUM(), to illustrate the function insert technique.

1. To record the function insert macro, first open a new spreadsheet document.

2. After the file is open, press [Alt]/ to open the Macro options dialog box.

3. Then, press [Enter] to choose the Record Macro option. Now, Works will display a dialog box that contains Playback key and Title text boxes.

4. In the Playback key text box, enter the key or key combination to which you want the macro linked. Although you can use a number of different key combinations for the playback key, let's use [Alt][Insert], a key combination Works doesn't use for any other purpose.

5. To assign this keystroke, simply press [Alt][Insert] and <altinsert> will appear in the Playback key text box.

6. To give the macro a descriptive title, move to the Title text box by pressing the [Tab] key, and type 'Insert SUM() function' (without the quotes).

7. Now, when you press [Enter], the macro recording process will start.

8. While you're in the Record mode, Works will display the word RECORD at the right end of the message line. At this point, type '=SUM()' (without quotes) into cell A1.

9. Now, press the left arrow key to move the cursor back on top of the closing parenthesis.

10. When you press the left arrow key, Works will display an alert box with the message 'Missing operand' because the function does not contain an argument. To clear the alert box from your screen, press [Enter].

11. Then, press the left arrow key again to position your cursor under the closing parenthesis. Since the cursor is now positioned on the closing parenthesis, the macro will leave you ready to enter the argument for the function.

12. Now, to end your macro recording session, press [Alt]/ and choose the End Recording option in the Macro options dialog box.

13. Finally, close the spreadsheet document you used to record your macro.

PLAYING YOUR SUM() FUNCTION MACRO

Now that you've recorded the SUM() function macro, we'll use it with a sample spreadsheet. This spreadsheet will use the SUM() function in cell locations B11, D11, E6:E9, and E11.


1. Move the highlight to cell B11 and press [Alt][Insert] to play the SUM() macro. The macro will pause to allow you to enter your cell range.

2. Type B6:B9 to enter the cell range for the SUM() function.

3. After you finish entering the cell range, press [Enter], and Works will place the sum of B6:B9 into cell B11. (Format all cells that contain dollar amounts as currency.)

4. You can continue with the steps above to enter the SUM() function in cells D11, E6:E9, and E11....just change the cell ranges for each SUM() function.

5. For the E6:E9 cells, use the Fill Down command after entering the cell range in E6.

6. Once you have a cell range (for a value) in E6, highlight the cell range E6:E9 and select the Fill Down command from the Edit menu.

**For more information on using Macros with Microsoft Works, please refer to your Microsoft Works for DOS Reference.

Search Keywords

Hint Category

Productivity Software

Date Created

17-04-97

Last Updated

17-12-98

Revision Date

17-12-99

Brand

IBM Aptiva

Product Family

Aptiva, PS/1

Machine Type

2011, 2121, 2123, 2133, 2155, 2168

Model

C01; C34; M01; NEA; T35; U35; A62; A82; A94; B82; C42; C92; G42; M82; S92; 081; 087; 131; 137; K37; N31; N81; 11E; 13T; 14C; 16E; 17A; 18A; 18T; 19C; 21C; 23C; 28A; 46M; 51D; D50; G11; G13; G43; G46; G46; G49; G49; G50; G53; M40; M40; M46; M46; P11; P13; P43; P50; P53; R04; R05; R06; R09; R38; R42; R43; R44; R84; R86; R87; RO3; S11; S13; S43; S45; S45; S47; S47; S48; S48; S50; S53; W11; W13; W42; W42; W43; W45; W45; W50; W53; 20E; 22T; 24C; 24M; 28V; 39E; 41T; 43C; 45V; 48E; 50T; 52C; 55V; 72E; 74T; 76C; 78C; 79C; 81A; 82E; 84T; 86C; 87C; CC1; D53; G14; G44; G52; G54; G72; G76; G78; G82; NM1; P14; P44; P57; P71; P74; P76; P78; P84; R14; R15; R16; R17; R18; R51; R52; R57; R58; R62; R63; R67; R71; R89; R93; R96; R97; S14; S44; S50; S54; S70; S75; S76; S78; S80; W14; W44; W48; W54; W67; W76; W77; W78; Z33; 28V; 31E; 33T; 37C; 38C; 51E; 54T; 56C; 57C; 88V; BB1; G57; G87; OR1; OR3; OR4; OR5; P89; R28; R29; R31; R74; R78; R82; R98; S55; S85; SR1; US1; W52; W82

TypeModel

2011C01

Retain Tip (if applicable)

Reverse Doclinks
and Admin Purposes