Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2022, 11:17 AM
nsaini01 nsaini01 is offline Remove Blank Rows in Tab to Email Mail Merge Windows 10 Remove Blank Rows in Tab to Email Mail Merge Office 2019
Novice
Remove Blank Rows in Tab to Email Mail Merge
 
Join Date: Mar 2022
Posts: 2
nsaini01 is on a distinguished road
Default Remove Blank Rows in Tab to Email Mail Merge

Hi I have multiple letters I need to email to recipients but I am using mail merge in a table format to pull in data from excel. Some letters needs all the line in the table while others only need half or even less. How do I prevent the empty rows to show in the final email, is there a marco or something else that can be used? I have attached table in word and excel where the info is pulled.



Thank you

Last edited by nsaini01; 03-25-2022 at 06:57 AM.
Reply With Quote
  #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,101
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 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
  #3  
Old 03-25-2022, 07:00 AM
nsaini01 nsaini01 is offline Remove Blank Rows in Tab to Email Mail Merge Windows 10 Remove Blank Rows in Tab to Email Mail Merge Office 2019
Novice
Remove Blank Rows in Tab to Email Mail Merge
 
Join Date: Mar 2022
Posts: 2
nsaini01 is on a distinguished road
Default

is there any way without using mail merge toolkit
Reply With Quote
Reply

Thread Tools
Display Modes


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:04 PM.


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