Sum(Above)

S

Silver

Hello,



I want to be able to add up lines in a Word table using =SUM(ABOVE) however
that only adds up correctly if there are numbers in every line. If there is
a vacant line it only displays the totals of numbers up to that line. Is
there a way of overcoming this?



Please help
 
G

Graham Mayor

Or add the individual cells that constitute the total.
Or use an Excel link for your calculations.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

Jane Pumroy

Please use this macro. It will work no matter which
column you are in or how many rows are in the table (we
have a document here that can span 24 pages). Works with
Word Visual Basic.

Sub SumColumn()
'
' SumColumn Macro
' Macro created 09/20/2004 by JAPUMROY
'
Dim Col As Integer
Dim Cell As Integer
Dim ColInfo

If Selection.Information(wdWithInTable) = False Then
MsgBox "The insertion point is not in a table."
End If
If Selection.Information(wdWithInTable) = True Then
Col = Selection.Cells(1).ColumnIndex
ColInfo = Chr(Col + 64)
End If
If Selection.Information(wdWithInTable) = True Then
Cell = Selection.Cells(1).RowIndex - 1
Set myRange = ActiveDocument.Words(1)
End If
myRange = "=SUM(" & ColInfo & "1:" & ColInfo & Cell
& ")"
Selection.InsertFormula Formula:=myRange,
NumberFormat:=""

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top