Lotus Subtotal Macro

The following list in Lotus' row and column format shows what to type into each cell to create the subtotal macro. Type the labels into column A. For example, put "TOP into cell A3. The double quote, ", tells Lotus to right justify the label. The rest of the cells are left justified, entered without the double quotes. All the formulas are entered in column B. For instance, {windowsoff}{paneloff} goes into cell B10. The section headers are in B1 and B8. Cell B30 is typed in as shown below, but it will display as {Let SUBT,@sum($C$56..$C$58)}. Column C only has two format labels in C5 and C6. There are no entries in columns D or E.

A B C D E

1 -------Variables---------
2 "COMPAREA
3 "TOP
4 "BOTTOM
5 "SUBT <-Format this cell as , 2
6 "TOT <-Format this cell as , 2 7 8
-------Procedures---------
9
10 "\I {windowsoff}{paneloff}
11 {GOTO}b50~/rncControlCode~{BS}~
12 {if @cell("type",ControlCode)="b"}{Branch ERR}
13 /dpfci{BS}.{END}{D}~o~g
14 /wdr~~
15 "\S {windowsoff}{Paneloff}
16 "PREP {indicate "One moment please..."}
17 {Goto}ControlCode~{Let Subt,0}{Let Tot,0}
18 {Let COMPAREA,@cellpointer("contents")}
19 {R}{Let TOP,@cellpointer("address")}~{L}
20 "LOOP {D}
21 {If @cellpointer("contents")<>COMPAREA}{DiffCode}
22 {If @cellpointer("type")<>"b"}{Branch LOOP}
23 EOJ {SUBTOT}{TOTAL}
24 {Calc}{Windowson}{panelon}{Indicate}{Quit}
25
26 "DIFFCODE {SUBTOT}{RESET}{RETURN}
27
28 "SUBTOT {U}{R}{Let BOTTOM,@cellpointer("address")}~
29 {Recalc FORM}
30 "FORM +"{Let SUBT,@sum("&TOP&".."&BOTTOM&")}"
31 {let TOT,TOT+SUBT}~
32 {R}/cCOMPAREA~~
33 {R}/rvSUBT~~
34 {L 3}{D}
35 {RETURN}
36
37 "RESET {Let COMPAREA,@cellpointer("contents")}
38 {R}{Let TOP,@cellpointer("address")}~{L}
39 {let SUBT,0}~
40 {return}
41
42 "TOTAL {R 2}**TOTAL**{R}/rvTOT~~
43 {RETURN}
44
45 "ERR Paste or import the text file
46 and press ALT-I again.~
47