View Single Post
  #9   Report Post  
Posted to microsoft.public.word.vba.general,microsoft.public.word.vba.userforms,microsoft.public.word.vba.beginners,microsoft.public.word.tables
Jezebel
 
Posts: n/a
Default Tricky: Word Table Conditional Formatting

Hilarious.



"macropod" wrote in message
...
Hi TomorrowsMan,

You can also do this without vba, using formula fields. For example, press
Ctrl-F9 three times to create a set of three nested fields:
{ { { } } }
then embed more fields within these so that you get:
{ { } { } { { } { } { { } { } { } }}}
and fill them out so that they look like:
{IF{GrandTotal} 1 "{GrandTotal \# 0.00} Fair" {IF{GrandTotal} 2
"{GrandTotal \# 0.00} Good" {IF{GrandTotal} 3 "{GrandTotal \# 0.00}
Great"
"{GrandTotal \# 0.00} Excellent"}}}
then apply the desired formatting to each of the output strings (eg
"{GrandTotal \# 0.00} Good").

Now, when you update the 'GrandTotal', the output will display in the
desired format. You can nest up to 20 IF tests this way in Word.

Cheers


"TomorrowsMan" wrote in message
oups.com...
Hi there,

I've got a stumper.....

First, I have a Word document with several form fields. Some of these
fields calculate into subsequent bookmarks.

The problem: At the end of the Word document, I have a simple "Overall
Score" table that is 2x4, laid out as such:

Ranking Rating
Fair 0-.99
Good 1-1.99
Great 2-2.99
Excellent 3-4.00

The rating is based on the value of a bookmark (GrandTotal) calculated
by a macro earlier in the document; the rating can be from 0-4 in
half-point increments. So, an average rating would be, for instance,
2.5, which would be a ranking of "Great."

What I need to happen is this: Once the "GrandTotal" bookmark
calculates (which it does OnExit from a previous form field), I would
like the associated row and column in the "Overall Score" table to
highlight; so, if the GrandTotal is 2.5, then "Great" and "2-2.99"
would become boldface text with a light blue background.

I have done this easily and often in Excel with conditional formatting
formulas, but I do not know how to embed the Excel table in Word and
have the conditional formatting run off of the Word table bookmark
"GrandTotal."

Is this possible; or, is there a way to do it with VBA in Word? Or, is
there some way to 'hide' the Word bookmark value is the embedded Excel,
so I can run the conditional formatting in there?

Cheers,
TomorrowsMan