View Single Post
  #4   Report Post  
Posted to microsoft.public.word.tables
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default How to suppress an entire row in a table, if no data?

Hi Lightjag,

Basically, its just a set of simple IF tests, coded along the lines of:
{IF{MERGEFIELD 2003Val}= "N/A" "" "Table Row with {MERGEFIELD 2003Val}"}
{IF{MERGEFIELD 2004Val}= "N/A" "" "Table Row with {MERGEFIELD 2004Val}"}
{IF{MERGEFIELD 2005Val}= "N/A" "" "Table Row with {MERGEFIELD 2005Val}"}
{IF{MERGEFIELD 2006Val}= "N/A" "" "Table Row with {MERGEFIELD 2006Val}"}
{IF{MERGEFIELD 2007Val}= "N/A" "" "Table Row with {MERGEFIELD 2007Val}"}

To create and run a mailmerge with one such row, you'd:
.. make a one-line table containing the mergefields for a single year.
.. select the and press Ctrl-F9 to wrap it in a field
.. reposition the cursor to the right of the first field brace '{' and press Ctrl-F9 again the insert a second field inside the
first, ahead of the table.
.. fill in the coding as indicated, replacing '2003Val' with the name of the field that returns 'N/A' when there's nothing for the
year (you can alos omit 'Table Row with ').
.. press F9 to update the field
.. run your merge.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Lightjag" wrote in message ...
Thanks! but what would the IF test look like?

ex/
Client 1 - "Table 1: approx 5 individual tables"
Year Return
2003 N/A = suppress this row
2004 N/A = suppress this row
2005 10%
2006 8%
2007 7%

Note: I can have the year and return columns pull blanks (i.e. "") from
excel, but I still need to suppress the blank rows.

Thanks in advance for help in writing the "IF Test".
"macropod" wrote:

Lightjag

You can't do that directly with a mailmerge.

You could, however, have 10 consecutive 1-row tables and use an IF test to determine whether a particular table should be
displayed.
If you set the paragraph that necessarily separates these table to 1pt high, they'll look much the same as a single table.

Alternatively, you could have have 10 consecutive tables with increasing row counts and use an IF test to determine which of
those
tables should be displayed.

In either case, you put the entire table within the corresponding IF test.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Lightjag" wrote in message ...


Q: how to suppress an entire row in a table, if the first row or column cell
is blank?

Background:

1) I am doing a mail merge will Excel 2007.

2) Excel data base: 100 clients each in a row with corresponding data
by year in each column.

3) Problem: I am sending a letter to each client with their data in a
table. Some clients have been with us for 10 years some have not, so the
first couple of rows in the table for some clients may be blank, how do it
suppress these rows?