Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-25-2022, 03:57 AM
gmayor's Avatar
gmayor gmayor is offline Remove Blank Rows in Tab to Email Mail Merge Windows 10 Remove Blank Rows in Tab to Email Mail Merge Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,138
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

There is no simple way to do this using out of the box mail merge to e-mail. You can however do it with E-Mail Merge Add-in if you run the following macro from the dialog:
Code:
Sub DelBlanks(oDoc As Document)
Dim oTable As Table
Dim oRow As Row
Dim oCell As Cell
Dim i As Long
Dim bTst As Boolean
    Set oTable = oDoc.Tables(1)
    For i = oTable.Rows.Count To 1 Step -1
        bTst = False
        Set oRow = oTable.Rows(i)
        For Each oCell In oRow.Cells
            If Len(oCell.Range) > 2 Then
                bTst = True
                Exit For
            End If
        Next oCell
        If bTst = False Then oRow.Delete
    Next i
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove Blank Rows in Tab to Email Mail Merge Mail Merge Template - remove blank rows in a table Litmus Mail Merge 16 03-23-2022 01:42 PM
Remove blank lines in mail merge using table wacobc Mail Merge 1 08-19-2021 09:10 PM
Remove Blank Rows in Tab to Email Mail Merge Mail merge: remove empty rows when a field is not showed Yarikh Mail Merge 4 09-23-2018 12:17 AM
Remove Blank Rows in Tab to Email Mail Merge How to remove blank spaces between rows in a table, Jamal NUMAN Word 2 04-28-2017 12:59 PM
Remove Blank Rows in Tab to Email Mail Merge How to remove blank rows from a specified range? Learner7 Excel 1 04-19-2011 02:45 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft