Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
Multipule Tables - Grand Total Formula
I am trying to add the total of multipule tables together, I have the formula
below that I have added to the VBA of "This Document" so that when the document opens the macro will run. I have two questions : 1. Where to I place the Format(total, "#,###.00") so that I have the correct deimal placing in the final total 2. Because I am running the macro every time the document opens I can end up with the answer multipule times, I could ask the users to run it manually but sometimes they forget and then the document will be mailed out without a Grand Total. I have reied to add a Delete before the marco starts but it is not working 100% My Current Macro is : Private Sub Document_Open() ActiveDocument.Bookmarks("GrandTotal").Select Selection.Delete Dim i As Long, total As Double Dim rsum As Range total = Format(total, "#,###.00") With ActiveDocument For i = 1 To .Tables.Count Set rsum = .Tables(i).Cell(6, 2).Range rsum.End = rsum.End - 1 If IsNumeric(rsum.Text) Then total = total + rsum.Text End If Next i End With ActiveDocument.Bookmarks("GrandTotal").Select Selection = "R" & total End Sub |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word 2003 Tables not givin right Total until printing | Microsoft Word Help | |||
I need to get a grand total from several embedded worksheets.... | Microsoft Word Help | |||
Calculate Total of two different tables, display result in a different table | Tables | |||
Mailmerge with multipule letters | Mailmerge | |||
Formula in table - Creating a final total from sub-total cells | Tables |