View Single Post
 
Old 05-22-2021, 03:05 AM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,338
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

All you would need to do is change:

Sub DeleteEmptyRows()
in the link to:
Sub DeleteEmptyRows(TargetDoc As Document)
and, in the same sub, change:
ActiveDocument.Tables
to:
TargetDoc.Tables

You can delete both 'Application.ScreenUpdating' rows from the 'DeleteEmptyRows' sub, too.

Then, after the line:
Set TargetDoc = ActiveDocument
in your existing sub, insert:
Call DeleteEmptyRows(TargetDoc)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote