The simplest thing to do is probably to create the Excel spreadsheet you
need, with all the data in one place, prior to mergeing. You might be able
to do that manually, or by using Excel features for referencing other data.
If you /have/ to get data from two Excel sheets into a single merge, there
will need to be some releationship between the two sheets that you can use
to get the right data from both sheets. For example, do both sheets have
some kind of reference code in each line (a customer code) ? Then there are
two main approaches, neither of them at all straightforward.
Suppose for example, both sheets have one row per customer, and each sheet
has a column called CustID. Then there are two ways in which you /might/ be
able to get the data intot the same merge:
a. set up the merge with the name and address data as the mail merge data
source. Then enable Word's DATABASE toolbar and use it to insert the total
amount column from Excel. Make sure you insert it as a field. Then use
Alt-F9 to view the field code, remove the \h in it, and change the SQL
statement to something like:
SELECT mytotalfield FROM mysheet WHERE CustID = '{ MERGEFIELD CustID }'
(where the {} are the special field braces you can insert using ctrl-F9
You'd need to change the field names and syntax, and probably omit the
'single quotes' if the CustID is numeric..
or
b. When you select your data sourc in Word, select the Tools menu in the
top right corner of the Select Data Source dialog box, and select MS Query.
Then work you way through that, creating a query base don two Excel "tables"
and modifying the SQL to create a Join based on the CustID columns. But I
won't even attempt to get into that unless you really want to.
--
Peter Jamieson
MS Word MVP
Lin said:
I have an invoice set up. I want to merge the names and addresses from
one excel work sheet and the total amount due from a different excel work
sheet to the invoice. I am using MS Word 2002. Can any one help me? I am
desperate!!