If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Alternatives to Sum(Above)
The sum(above) function is flakey to say the least has anyone written a
replacment vba macro to perfor the same function? Thanks, Dan |
#2
|
|||
|
|||
See http://word.mvps.org/FAQs/AppErrors/...eIncorrect.htm
-- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "solex" wrote in message ... The sum(above) function is flakey to say the least has anyone written a replacment vba macro to perfor the same function? Thanks, Dan |
#3
|
|||
|
|||
See http://word.mvps.org/FAQs/AppErrors/...eIncorrect.htm
-- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "solex" wrote in message ... The sum(above) function is flakey to say the least has anyone written a replacment vba macro to perfor the same function? Thanks, Dan |
#4
|
|||
|
|||
Alot of people point to that page but it would not solve my problem. I am
using word as a reporting template to output access data. The user does not want to interact with word and any point except the initial design of the document. My solution was to create a new tag to represent the number of rows in the sum formula and then subsitute that tag with number of rows after the data has been inserted. Apparently the SUM(A1:A50) does not exhibit the same problems as SUM(ABOVE). Thanks, Dan Example of the field with the new tag: { = SUM(B3:BROWS /) \# "#,##0;(#,##0)" } I then call this routine to update the formulas in the document. Public Sub FieldTagSubsitution(ByRef doc As Word.Document, _ ByVal Tag As String, ByVal ReplaceWith As String) ' Looks through the fields for the specified tag and ' replaces the tag with the passed in value then updates the fields. Dim fld As Word.Field Dim code As String For Each fld In doc.Fields code = fld.code.Text If InStr(code, Tag) 0 Then fld.code.Text = Replace(code, Tag, ReplaceWith) fld.Update End If Next Set fld = Nothing End Sub "Suzanne S. Barnhill" wrote in message ... See http://word.mvps.org/FAQs/AppErrors/...eIncorrect.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "solex" wrote in message ... The sum(above) function is flakey to say the least has anyone written a replacment vba macro to perfor the same function? Thanks, Dan |
#5
|
|||
|
|||
Hi Dan,
The two-table solution mentioned at: http://word.mvps.org/FAQs/TblsFldsFms/TotalColumn.htm (url all one line) would seem ideally suited to your situation. For more information on the limitations of SUM(ABOVE) etc, and solutions to various field math problems, check out: http://www.wopr.com/cgi-bin/w3t/show...&Number=365442 (url all one line) Cheers "solex" wrote in message ... Alot of people point to that page but it would not solve my problem. I am using word as a reporting template to output access data. The user does not want to interact with word and any point except the initial design of the document. My solution was to create a new tag to represent the number of rows in the sum formula and then subsitute that tag with number of rows after the data has been inserted. Apparently the SUM(A1:A50) does not exhibit the same problems as SUM(ABOVE). Thanks, Dan Example of the field with the new tag: { = SUM(B3:BROWS /) \# "#,##0;(#,##0)" } I then call this routine to update the formulas in the document. Public Sub FieldTagSubsitution(ByRef doc As Word.Document, _ ByVal Tag As String, ByVal ReplaceWith As String) ' Looks through the fields for the specified tag and ' replaces the tag with the passed in value then updates the fields. Dim fld As Word.Field Dim code As String For Each fld In doc.Fields code = fld.code.Text If InStr(code, Tag) 0 Then fld.code.Text = Replace(code, Tag, ReplaceWith) fld.Update End If Next Set fld = Nothing End Sub "Suzanne S. Barnhill" wrote in message ... See http://word.mvps.org/FAQs/AppErrors/...eIncorrect.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "solex" wrote in message ... The sum(above) function is flakey to say the least has anyone written a replacment vba macro to perfor the same function? Thanks, Dan --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.736 / Virus Database: 490 - Release Date: 9/08/2004 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
More alternatives to text boxes. | David Young | Page Layout | 2 | April 26th, 2004 04:47 PM |