Suppress lines containing a blank cell Word 2003

  doctorhappy 16:16 15 Jan 2008
Locked

Is there any way of suppressing a row in a table that contains a blank cell. The table is 2 columns wide. The first column contains text. The second column contains merged data. If that merged data is blank I want to suppress the line. Any idea's?

  Diemmess 16:38 15 Jan 2008

I'm intrigued, but haven't much to offer.

I assume that "suppressing a row" means making the lines invisible without changing the cell?

Certainly every line in a table can be altered to suit yourself, but as far as I know such details are made manually to an otherwise complete piece of work.

I you want to do this automatically then I don't think even Word can manage that.

  Taff™ 11:16 16 Jan 2008

It cant be done in a table but couldn`t you simply set it up in another way using normal formatting? I use the "Insert Word Field" function and then "Skip Record If" it is blank.

It might help if you gave me some more info on the data and fields you are trying to merge. Perhaps a simplified example.

  doctorhappy 11:43 16 Jan 2008

Thanks for the replies. I have two columns. Column A contains a description of what will appear in column B (for example column A contains 3 rows which say 'oranges', 'apples' and 'bananas'). Column B will then, via a merge, contain data relating to the item in column A (so it might be quantity hence I will get in column B '5', '19 and '4'. However, if a quantity is missing from the merge (i.e. it is blank) then I don't want that row to print at all.
Am I complicating this?

  Diemmess 11:53 16 Jan 2008

Your problem is just the sort of thing for which Excel or particularly Access was made for.

Perhaps like me, you prefer to stay with what you know!

  doctorhappy 12:11 16 Jan 2008

Yes I agree. In fact my source document for the merge is Excel. My Access skills are, however, very basic. I need a decent looking finished document hence the use of Word...

  MAJ 12:28 16 Jan 2008

If all else fails, do it in Excel, then you could copy and paste that into your Word Document. I think it should then act the same as it would in Excel.

  MAJ 12:29 16 Jan 2008

Should have said Copy and Paste Special.

  Taff™ 12:13 17 Jan 2008

Lets assume you have an excel spreadsheet with two columns headed Description & Quantity. This will work if zero`s in Quantity are actually blank cells.

Open Word and go to Tools>Options and on the general tab tick "Confirm conversion on open". On the view tab set Field Shading to "Always". Now open a new document and go to View>Toolbars and select Mailmerge. From the mailmerge toolbar select the main document setup icon and select "Directory". Click the Open Data Source icon and navigate to your Excel file. When you open this it will give you the file conversion options - select Microsoft Excel via converter. Then select the relevant sheet.

Select Insert Mergefield and choose If,Then,Else. In the field select Quantity and in the next box select "Is Not Blank". Type DESCRIPTION in caps in the insert this text box and select OK. Now click on the insert merge field icon and select the Description field. Place a tab immediately afterwards to give a clear space and then insert the merge field Quantity and a carriage return.

Select and copy the "Description" field. Now highlight the entire paragraph and holding the shift key down press the F9 key - you should now see the code including DESCRIPTION in caps. Select DESCRIPTION and paste in the field which is on your clipboard. The first part of the code before the tab should now look like this:

{IF { MERGEFIELD Quantity }<> "" "{ MERGEFIELD " Description" }" "" }

Effectively you have nested the Description field into the If, Then Else word field. Now merge to a new document to try it.

  Taff™ 16:16 18 Jan 2008

Post back if there`s a problem!

  doctorhappy 09:37 21 Jan 2008

Hi Taff,
Thanks for that, it looks like that might just do the trick when I carry out this function again. For now, I have decided to alter my layout so I do see rows I don't need but it does not affect the appearance of the finished report unduly.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

WPA2 Hack Latest News: How Secure is your Wi-Fi?

Photoshop CC 2018 released with new Curvature Pen and better brush tools

Best kids apps for iPhone & iPad

Comment utiliser Twitter ?