![]() |
|
#1
|
||||
|
||||
![]()
Try:
Code:
Sub MailMergeToDoc() Application.ScreenUpdating = False Dim Tbl As Table, c As Long, r As Long, StrVal As String ActiveDocument.MailMerge.Execute For Each Tbl In ActiveDocument.Tables With Tbl For r = .Rows.Count To 1 Step -1 If Len(.Rows(r).Range.Text) = .Rows(r).Cells.Count * 2 + 2 Then .Rows(r).Delete Else For c = 3 To 4 StrVal = Split(.Cell(r, c).Range.Text, vbCr)(0) If InStr(StrVal, "") > 0 Then StrVal = Replace(Replace(Replace(StrVal, ".", "|"), ",", "."), "|", ",") .Cell(r, c).Range.Text = StrVal End If Next End If Next End With Next Application.ScreenUpdating = True End Sub For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Hi,
you are the best This macro is very helpful and it works perfect in all the fields except one(pls see the pic). Is there any limitation in the macro? I use the \#00.00,€ format in the mergefileds and my table has maximum 12 rows. My data in excel is in the € Euro (123 €) --> "#,##0.00 [$€-x-euro1]_);(#,##0.00 [$€-x-euro1])" format |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
cluyster1127 | Mail Merge | 13 | 12-11-2019 01:05 PM |
![]() |
Crosby87 | Mail Merge | 33 | 07-16-2019 02:24 AM |
![]() |
rtcary | Mail Merge | 1 | 01-20-2018 02:07 PM |
![]() |
Ziad El Hachem | Word VBA | 4 | 03-21-2017 06:55 PM |
![]() |
BeerStud | Mail Merge | 1 | 11-28-2014 06:29 PM |