ID: Q114114
6.00 6.00a WINDOWS kbusage kbtable kbmacro kbtemplate
The information in this article applies to:
When you merge table cells, Word 6.0 for Windows references the merged cells differently in relation to the table than do earlier versions of Word. This may cause unexpected results in Word 6.0 when you use formulas such as =SUM(ABOVE) in tables you created in Word 2.x.
By design, Word 6.0 renumbers the cells in the entire table row when you merge one or more cells in that row. For example, if you merge cells A2 and B2, Word renumbers the row so cell C2 becomes B2, as shown in the following example:
----------------------
| A1 | B1 | C1 |
----------------------
| A2 | B2 | -----> Word 6.0 omits cell C2
----------------------
| A3 | B3 | C3 |
----------------------
By contrast, Word 2.x (which uses relative cell references) retains the
original cell references and does not renumber the cells in the row when
you merge cells in that row. When you merge table cells in Word 2.x, Word
treats the merged cell references as "hidden." In the following example, in
which cells R2C1 and R2C2 are merged, notice that the table no longer
includes cell R2C2:
----------------------
| R1C1 | R1C2 | R1C3 |
----------------------
| R2C1 | R2C3 | -----> Word 2.x skips cell R2C2
----------------------
| R3C1 | R3C2 | R3C3 |
----------------------
In Word 6.0, when you open a Word 2.x document or template that contains
merged table cells, Word 6.0 maintains the cell references, so a table
calculation in a converted document may yield different results than one in
a table you originally created in Word 6.0.
For example, if you open the Word 2.x table shown above in Word 6.0, Word 6.0 numbers the table cells as follows (notice that cell B2 is missing in the Word 2.x table):
----------------------
| A1 | B1 | C1 |
----------------------
| A2 | C2 | -----> Word 6.0 skips cell B2 in
---------------------- converted Word 2.x table
| A3 | B3 | C3 |
----------------------
As a result, formulas such as =SUM(ABOVE) or =SUM(BELOW) use different
cells to calculate the result, depending on which version of Word you used
to create the table. For example, in Word 6.0, if you insert the following
formula in cell B3 of one table you created in Word 2.x and in cell B3 of
another table you created in Word 6.0
{= SUM(ABOVE)}
then Word sums cells B1 and B2 in the Word 6.0 table, but Word sums B1 only
in the Word 2.x table. In other words, in the Word 2.x table, cell B2 is
"hidden," so Word 6.0 does not include it in the calculation.
TIP: To see which cells Word includes in a specific column, position the insertion point in a cell, then choose Select Column from the Table menu.
The Invoice template (INVOICE.DOT), supplied with Word 6.0, contains a converted Word 2.x table. The last row of the table contains two cells (A12 and D12), but the first cell was created by merging three cells together (cells A12, B12, and C12). The last formula in the table references cells in column D, which is the second column in this table. If the table had been created originally in Word 6.0, the formula would reference column B.
Method 1: In tables that contain merged cells in which relative formulas
such as =SUM(ABOVE) do not yield correct results, use specific
cell references in the formula instead. For example, use =B1+A2.
For large groups of cells, refer to specific cell ranges; for
example, use =SUM(B1:B4,A5,B6:B8).
Method 2: Select the cells you want to use in a formula and assign a
bookmark to the selection using the Bookmark command on the Edit
menu. Then use the bookmark name in the formula. For example,
use =SUM(BookmarkName).
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
You can use the following macro to report row, column, and cell information about a table:
Sub MAIN
LF$ = Chr$(13) + Chr$(10)
If SelInfo(12) = - 1 Then
TR$ = Str$(SelInfo(15))
TC$ = Str$(SelInfo(18))
CR$ = LTrim$(Str$(SelInfo(13)))
S$ = "The table has" + TR$ + " rows." + LF$
S$ = S$ + "This row has" + TC$ + " columns."
S$ = S$ + LF$ + "This cell is "
S$ = S$ + Chr$(SelInfo(16)+64) + CR$ + "."
MsgBox S$
Else
MsgBox "The Insertion Point must be in a table!"
EndIf
End Sub
"Microsoft Word User's Guide," version 6.0, pages 296-297, 300-302
KBCategory: kbusage kbmacro KBSubcategory: kbtable kbtemplate Additional reference words: 6.00 6.00a merged cells incorrect sum word6 winword above results product
Keywords : kbtemplate kbtable
Version : 6.00 6.00a
Platform : WINDOWS
Last Reviewed: February 6, 1998