View Single Post
 
Old 04-27-2015, 06:48 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

This should address your two follow on questions:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim lngIndex As Long, lngLength As Long
Dim oRow As Row
  If Selection.Tables(1).Columns.Count = 3 Then
    Do
      If Len(Selection.Tables(1).Rows.Last.Range.Text) = 8 Then
        Selection.Tables(1).Rows.Last.Delete
      Else
        Exit Do
      End If
    Loop
    Selection.Tables(1).Rows.Last.Borders(wdBorderBottom).Color = Selection.Tables(1).Rows.First.Borders(wdBorderTop).Color
  End If
  If Selection.Tables(1).Columns.Count = 7 Then
    Do
      Set oRow = Selection.Tables(1).Rows.Last
      lngLength = 0
      For lngIndex = 2 To 6
        lngLength = lngLength + Len(oRow.Cells(lngIndex).Range.Text)
      Next lngIndex
      If lngLength = 10 Then
        oRow.Delete
      Else
        Exit Do
      End If
    Loop
  End If
  Selection.Tables(1).Rows.Last.Borders(wdBorderBottom).Color = Selection.Tables(1).Rows.First.Borders(wdBorderTop).Color
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote