View Single Post
 
Old 07-16-2019, 02:24 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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 t As Long, r As Long, bDel As Boolean
ActiveDocument.MailMerge.Execute
With ActiveDocument
  For t = .Tables.Count To 1 Step -1
    With .Tables(t)
      If Split(.Cell(1, 1).Range.Text, vbCr)(0) Like "#### Awards (Vesting ####)" Then
        bDel = True
        For r = .Rows.Count - 1 To 2 Step -1
          If Trim(Split(.Cell(r, 1).Range.Text, vbCr)(0)) Like "[DPR][BS]P Award" Then
            If Split(.Cell(r, 4).Range.Text, vbCr)(0) <> "" Then
              bDel = False
            Else
              .Rows(r).Delete
            End If
          End If
        Next
      If bDel = True Then .Delete
      End If
    End With
  Next
End With
Application.ScreenUpdating = False
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote