View Single Post
 
Old 08-07-2024, 08:03 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
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

You could, for example, add the following macro to your mailmerge main document, then save it in the .docm format before running the mailmerge.
Code:
Sub MailMergeToDoc()
Application.ScreenUpdating = False
Dim t as long, r As Long
ActiveDocument.MailMerge.Execute
With ActiveDocument
  For t = .Tables.Count to 2 Step - 2
    With .Tables(t)
      For r = 5 To 2 Step -1
        Select Case r
          Case 5, 4, 2
            If Split(.Cell(r, 2).Range.Text, vbCr)(0) = "$0.00" Then
                .Rows(r).Delete
              Next
            End If
        End Select
      Next
    End With
  Next
End With
Application.ScreenUpdating = False
End Sub
For PC macro installation & usage instructions, see: Installing Macros
For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote