Controlling when merged values appear in MS Word 2004

D

David Schwartz

I'm creating a catalog in Word based on an Excel spreadsheet. The main
organizing field (group) repeats its value record after record. Is
there a way I can set it up so that it only displays when its value
changes?

TIA,
David


PowerPC iMac, Dual Core iMac 20" (2Gb RAM), iPod 30Gb Mac OS X
(10.4.9) OS X 10.3.9 on PowerPC
 
J

John McGhie [MVP Word, Word Mac]

Hi David:

You can do this, but it would be "extreme programming" to do it in Word.

Do it in Excel before the data gets to Word.

Create a second computed column, with a formula that blanks the cell in the
computed column unless the one above it in the group-by column is different.

In case you can't figure it out, I have gross-posted into the Excel group
where messers Gordon and McGimpsey can have a bite at it...

Cheers

--

Please reply in the group. Please do NOT email me unless I ask you to.

http://jgmcghie.fastmail.com.au/

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
Sydney, Australia. GMT + 10 Hrs
+61 4 1209 1410, mailto:[email protected]
 
P

Peter Jamieson

Generally speaking it's better to fix your data source, but as long as you
aren't merging into table rows, if your main organising file is called
"myfield", you can use something like

{ IF { MERGESEQ } = "1" "{ SET myfieldlocal "" }" ""
}{ IF "{ MERGEFIELD myfield }" = "{ REF myfieldlocal }"
"" "{ MERGEFIELD myfield }"
}the rest of your fields and text

then at the end
{ SET myfieldlocal "{ MERGEFIELD myfield }" }


All the {} have to be the "special field code braces", not the sort you can
just type on the keyboard.

Don't expect { MERGESEQ } to be set correctly until you actually merge.

Peter Jamieson
 
J

JE McGimpsey

"gross-posting" again, John? <g>

Couple of ways to do this, depending on what you mean when you say that
the Word catalog is "based on" the Excel spreadsheet - are you using an
XL workbook as a data source for a merge? Or embedding a worksheet in a
Word document? Copying an XL range and pasting it into Word as a table?

In XL, the easiest way to hide repeating values is to use conditional
formatting. For instance, say the repeating values are in column A:

A B
1 Value1 Option1
2 Value1 Option2
3 Value2 Option1
4 Value2 Option2
5 Value2 Option3
6 Value3 Option1

Select A2:Ax, where x extends as far as you need, with A2 the active
cell. Choose Format/Conditional formatting... Set the dropdown/inputbox
to read

Condition 1: Formula is =A2=A1

Click Format, and in the Font pane of the Format dialog, set the color
equal to the background color of the cells.

If you then copy your data and paste it in Word using Edit/Paste
Special/Paste Link as an Excel Worksheet object, the repeating headers
will be hidden.
 
D

David Schwartz

"gross-posting" again, John? <g>

Couple of ways to do this, depending on what you mean when you say that
the Word catalog is "based on" the Excel spreadsheet - are you using an
XL workbook as a data source for a merge? Or embedding a worksheet in a
Word document? Copying an XL range and pasting it into Word as a table?
I'm doing a merge so this won't work; thanks though

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top