Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need to Hide zero values in tables

294 views
Skip to first unread message

Check

unread,
Sep 23, 1998, 3:00:00 AM9/23/98
to
I have several forms that have been automated in word through the use of
tables and form fields. There is some calculation done as well. However if
the value is "0" I don't want it to appear. I know this can be done in
Excell but can it be done in Word97

Suzanne S. Barnhill

unread,
Sep 23, 1998, 3:00:00 AM9/23/98
to
The easiest way to do this is to format the text as white. It won't print
(or even display on the screen), but it is still there. I'm sure our macro
gurus can tell you how to automate this, so that it is automatically white
if the value is zero.

--
Suzanne S. Barnhill
Words into Type
sbar...@zebra.net

Get answers to your software questions via email at
http://www.allexperts.com

Doug Robbins

unread,
Sep 24, 1998, 3:00:00 AM9/24/98
to
Hi,

In the Table>Formula dialog, place # in the Number Format: box.

Regards,

Doug Robbins - Word MVP
Check <ala...@sprint.ca> wrote in message 36098...@news.wincom.net...

Doug Robbins

unread,
Sep 25, 1998, 3:00:00 AM9/25/98
to
Hi Laurie,

I wasn't feeling real smart last night and missed the fact that you are
using formfields.

I note that you are using the $#,##0.00;($#,##0.00) format in the Number
format box of the formfield properties dialog. If you replace that with
$#,###.##;($#,###.##) you will get just the $ instead of $0.00 if there is
nothing entered into the forms that contribute to the calculation. If you
don't want the $ in empty fields, you have two choices, not have it at all,
or use a macro to calculate the result for each field.

The following are the commands that you would use for such a macro:

' Macro created 10-09-98 by Doug Robbins to prevent display of $0.00
' if product of two fields is zero.
'
text1 = ActiveDocument.FormFields("text1").Result
text2 = ActiveDocument.FormFields("text2").Result
text1 = Val(text1)
text2 = Val(text2)
Text3 = text1 * text2
If Text3 <> 0 Then
Text3 = Format(Text3, "$#,##0.00; ($#,##0.00)")
ActiveDocument.FormFields("text3").Result = Text3
Else
ActiveDocument.FormFields("text3").Result = ""
End If

The above calculates the product of two fields, you would need to modify it
for each case in your form, and a separate macro is required to obtain the
result for each calculation in the form.

The macros should be run on exit from each of the fields that contribute to
the result of each calculation.

Hope this helps.

Regards,

Doug Robbins - Word MVP

-----Original Message-----
From: Andrew Laurie <ala...@sprint.ca>
To: Doug Robbins <doug_r...@email.msn.com>
Date: Friday, September 25, 1998 5:00 AM
Subject: Re: Need to Hide zero values in tables


>Dear Doug,
> Thankyou very much for your reply. However I tried your
>suggestion but was unable to make it work. I will send an attachment for
you
>to show me how it works.
>Regards Andrew Laurie

0 new messages