View Single Post
 
Old 10-01-2014, 01:40 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

You can test the whole row instead of the individual cells:

Code:
Sub PrintAllTest()
Dim oTbl As Table, lngIndex As Long, lngCols As Long, oUndo As UndoRecord
  Application.ScreenUpdating = False
  Set oUndo = Application.UndoRecord
  oUndo.StartCustomRecord ("DeleteRows")
  With ActiveDocument
    For Each oTbl In .Tables
      lngCols = oTbl.Columns.Count
      For lngIndex = oTbl.Rows.Count To 1 Step -1
        If Len(oTbl.Rows(lngIndex).Range) = (2 * lngCols) + 2 Then
          oTbl.Rows(lngIndex).Delete
        End If
      Next lngIndex
    Next oTbl
  End With
  Application.ScreenUpdating = True
  oUndo.EndCustomRecord
  MsgBox Dialogs(wdDialogFilePrint).Show
  ActiveDocument.Undo
lbl_Exit:
  Set oUndo = Nothing
  Set oTbl = Nothing
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote