+ Reply to Thread
Results 1 to 3 of 3

Mail Merge Question

Hybrid View

  1. #1
    Registered User
    Join Date
    01-25-2011
    Location
    St. Louis
    MS-Off Ver
    Excel 2003
    Posts
    5

    Mail Merge Question

    I need help with combining several records from an excel spreadsheet into one mail merge document. Specifically, I have multiple records for one customer and wish to display some of the fileds on the document. My worksheet has enough space for 8 acct #'s and corresponding data but cannot write the code so that Word will pull in all the data for each customer. I have attached my doc and data file which is setup fine for merge but cannot code for sequential data to be pulled with a unigue key field. Example: ABC Co. has 4 records, I need to display all four account#.'s and respective data for that record in respective rows.Any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Mail Merge Question

    I was able to get the merge to go like you stated but it only pulls 1 record for each customer...so I'm wondering if a VBA UserForm may be a better fit for this situation?

    Hopefully some of the members with more experience in Word will chime in here and give some suggestions.
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Mail Merge Question

    You have to distinguish a situation in which every customer has the same fixed amount of lines and the situation that every customers has a variable number of lines.

    For the fist situation see attachment 1, for the second attachment 2.

    In the variable-lines case it is necessary to separate each customer in the Excel file by an empty row.
    NB. the crux is in the mergefields. Look at those; using Alt-F9



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1