![]() |
|
#2
|
||||
|
||||
|
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 Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Mail Merge to create specific number of table rows
|
flackend | Mail Merge | 4 | 12-01-2023 02:49 PM |
Mail merge with multiple rows of data
|
ARoude | Mail Merge | 3 | 09-10-2018 02:32 PM |
Deleting rows based on the text in certain cells VBA
|
ThisGuyJohn | Excel Programming | 5 | 02-03-2017 03:16 PM |
Excel VBA Macro - Deleting Specific Data based on criteria
|
MD011 | Excel Programming | 3 | 12-10-2014 02:15 AM |
Mail Merge to print specific record based on mergefield criterias
|
nicnad | Mail Merge | 1 | 02-22-2012 01:53 AM |