View Single Post
 
Old 04-25-2012, 03:21 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,213
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

Hi mj1856,

Here's a macro to correct the table's formatting - even if changes in your document's layout changes which rows are on a given page. Simply position the selection point anywhere in the table then run the macro.
Code:
Sub CorrectTblBorders()
Application.ScreenUpdating = False
Dim Tbl As Table, iRw As Long, iPg As Long
With Selection
  If .Information(wdWithInTable) = False Then Exit Sub
  Set Tbl = .Tables(1)
End With
With Tbl
  .Style = .Style
  iPg = .Rows(1).Range.Information(wdActiveEndPageNumber)
  If .Range.Characters.Last.Information(wdActiveEndPageNumber) = iPg Then GoTo Done
  For iRw = 2 To .Rows.Count
    If .Rows(iRw).Range.Information(wdActiveEndPageNumber) = (iPg + 1) Then
      .Rows(iRw - 1).Cells(1).Borders = .Rows(.Rows.Count).Cells(1).Borders
      iPg = iPg + 1
    End If
  Next iRw
End With
Done:
Set Tbl = Nothing
Application.ScreenUpdating = True
End Sub
To see how to install & run a macro, go to: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote