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

Converting the table to text is unlikely to resolve your problems.

The following macro will repair all except the last row of your table:
Code:
Sub FixTable()
Application.ScreenUpdating = False
Dim r As Long, c As Long, RngSrc As Range, RngTgt As Range
With ActiveDocument.Tables(1)
  For r = .Rows.Count To 3 Step -1
    IsDate (Trim(Split(.Cell(r, 1).Range.Text, vbCr)(0)))
    If IsDate(Trim(Split(.Cell(r, 1).Range.Text, vbCr)(0))) = False Then
      For c = 1 To .Rows(r).Cells.Count
        Set RngSrc = .Cell(r, c).Range
        If RngSrc.Paragraphs.Count > 1 Then
        RngSrc.End = RngSrc.Paragraphs(1).Range.End - 1
        Set RngTgt = .Cell(r - 1, c).Range
        With RngTgt
          .End = .End - 1
          .Collapse wdCollapseEnd
          .FormattedText = RngSrc.FormattedText
          .InsertBefore " "
        End With
        RngSrc.Paragraphs(1).Range.Text = vbNullString
        End If
      Next
    End If
  Next
End With
Application.ScreenUpdating = True
End Sub
For PC macro installation & usage instructions, see: Installing Macros
For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote