#1
|
|||
|
|||
Merge All Cells in a Table via Macro
Hi - I'm making a Company Christmas Letter and each letter has a message from a unique group of signers. I used Graham Mayor's Multi-to-One Mail Merge to make the letters and it worked perfectly. But I have an issue with formatting I can't figure out. I had to insert a table to get the correct message/signature to line up w/ each other - (note: the message is in a different color/format than the signature) but they show up next to each other horizontally vs vertically aligned since it's a table. However, I would like it for each message to be on top of its signature. A quick fix I found was to just merge all cells in the table afterwards and it solves that formatting issue. But I have to do that manually across all 7,500+ letters then. Is there a macro I could run or setup the document differently to prevent this issue? (I figured creating a Macro makes the most sense - but sorry if I posted in the wrong thread- first timer!) |
#2
|
||||
|
||||
Cross-posted at: How to Merge All Cells on a Table Across Multiple Pages - Microsoft Community
For cross-posting etiquette, please read: Excelguru Help Site - A message to forum cross posters
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
You should be able to do all this without generating table cells that need to be merged post-mailmerge.
Without actually seeing the problem mailmerge main document, however, it can be difficult for anyone to diagnose the issue. Can you attach the mailmerge main document to a post with some representative data (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
More Data
Thanks for the info! I've attached the mail merge doc I've been having difficulty with and sample excel w/ fake data.
|
#5
|
||||
|
||||
It's not apparent from either your mailmerge main document or your test workbook why you'd use a many-to-one merge rather than an ordinary letter merge. It's also not apparent why you have some of the content in the page header rather than in the document body. And, finally, there is no table in the document to show what it is you're trying to work around.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
More Info
From the test excel - all the Signers (Column A) need to have their Message (G)/Signature(H) on a Partner (B) Letter - that's the many (messages/signatures) to one (partner) ratio. I've attached a completed example when I run the Many to One with the test info using the Mail Merge Doc provided. I then have to go in click Merge Cells to the whole Table to get the desired outcome (before/after attached). I'm looking to avoid manually having to merge all the cells in the table to get the Message and the Signature to correspond w/ each other in the proper format.
The header is different since we are printing on special letterhead - it's not relevant to the issue though. Also the table is in there it's just borderless, if you put on the gridlines on you'll see the table. I've used a table since w/out the table it was not putting the message w/ the signature. Just doing - message message message signature signature signature Thanks! |
#7
|
||||
|
||||
So what doesn't work with the mailmerge main document formatted as per the attached?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
Reply
The desired outcome is
message signature message signature vs (w/ table) message signature message signature or (w/out table) message message signature signature I can't seem to run the many to one mail merge correctly (message correspond w/ signature) without a table and then manually merging all the cells in the table to get the desired outcome. |
#9
|
||||
|
||||
Did you try the attachment to my previous post?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
I get a Run-time Error 50290 when I try to run what you provided in your previous post.
I have tried that formatting though on my own and I get the below instead: Message Message Message Signature Signature Signature |
#11
|
||||
|
||||
I doubt the Run-time Error has anything to do with the document I attached.
Nevertheless, it can all be done without a macro. Try the following attachment as a Directory merge.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#12
|
|||
|
|||
The attached worked! Thanks so much!
|
#13
|
||||
|
||||
FWIW, the field coding is based on my Microsoft Word Catalogue/Directory Mailmerge Tutorial: https://www.msofficeforums.com/mail-...-tutorial.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
macro help, many to one mail merge, merge tables |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro for merging cells in a word table | dana_c_83 | Word VBA | 3 | 04-29-2020 03:04 PM |
Merge table cells across columns but skip if column don't exist | jhearing | Word Tables | 4 | 05-31-2016 06:20 AM |
Macro to split table cells | nachiketapte | Word VBA | 10 | 03-08-2016 04:07 AM |
Macro to loop through all cells in a table produced by a mail merge | elh52 | Word VBA | 4 | 08-31-2014 10:50 PM |
Macro to Merge Cells Row By Row in a Table | KD999 | Word VBA | 4 | 02-20-2012 08:51 PM |