Results 1 to 8 of 8
  1. #1
    S Bernhard
    Guest

    Word table formulas

    I am working in Word 97 SR-2 on a Windows NT network.
    We have a document available to multiple users with a two-column table set up for numerical entries. We've been using it as a paper form submission which was hand-totaled. The powers that be have requested that those columns be set up so they can be totaled automatically as each user makes their entries and submitted electronically. I have tried entering zeros in all cells and using the =sum(above) and autosum commands as well as setting up a sum formula using cell addresses. I have also tried setting it up in Excel and importing it into Word, but once it is saved in Word it doesn't seem to hold the ability to tabulate as the numbers are entered. I am a newby to macros, so don't know what or how to write one for this application. Any suggestions?
    Thanks,

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Word table formulas

    When you entered the Sum(above) formula did you just type it in or did you use the Table|Formula menu ? You can enter it manually provide you press Ctrl-F9 first and then between the two resultant Braces, {}, enter =Sum(Above). The formula should look like <big>{=Sum(Above)}</big>

    When you have done that right click on the formula and select Update Field, right click again and select Toggle Field Codes.

    If that does not sort the problem let us know the specific error you get with the Sum(above) formula.

    Regards,

    Andrew C

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Word table formulas

    You need to update the field in order to see the new number. You can put in a macro if you need to but just clicking on the field and pressing F9 would do the same.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Word table formulas

    This can also be done by setting the document up as a protected form, and having On Exit macros which do the calculations automatically every time an entry is made.

    It's a bit of work to set up, but it's nice and secure in that the users can't readily tamper with the totals.

    (and a good use for a Word form, Chris!)

  5. #5
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word table formulas

    Hi,

    Actually, the "Sum(ABOVE)" formula does not calculate in all cases- see <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q185/0/56.ASP>the Microsoft Knowledgebase article</A> on this.

    I prefer the second workaround mentioned- using Excel-type references: "{Sum(A1:A5)}"
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  6. #6
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word table formulas

    The coding on the on exit macro would look something like this:

    Sub RefreshFields()
    ActiveDocument.Fields.Update
    End Sub


    After adding the macro, you can then set the "On Exit" macro to "Refresh Fields" for any (and every) form field which is included in the calculation, as Gary says.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  7. #7
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Word table formulas

    Yeesh. Shows you how backwards I am about fields:
    I just finished creating an overtime form. Didn't use calculation fields - instead I built functions for all the different calculations required - these are called from the OnExit macros - three pages of lovely code. Great exercise, I guess....[img]/w3timages/icons/doh.gif[/img] - at least they work reliably, unlike Sum[img]/w3timages/icons/grin.gif[/img]

  8. #8
    S Bernhard
    Guest

    Re: Word table formulas

    Thanks for the suggestions. I had the formula correct, but did not update the field after each entry. It works perfectly.

    Sandy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •