View Single Post
 
Old 04-29-2020, 11:49 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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 PC macro installation & usage instructions, see: Installing Macros
For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote