View Single Post
 
Old 06-08-2020, 03:13 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Try the following macro:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Tbl As Table, Cll As Cell, Str As String
For Each Tbl In ActiveDocument.Tables
  With Tbl.Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "([!.\!\?\:\;])(^13)"
    .Replacement.Text = "\1.\2"
    .MatchWildcards = True
    .Forward = True
    .Format = False
    .Wrap = wdFindStop
    .Execute Replace:=wdReplaceAll
  End With
  For Each Cll In Tbl.Range.Cells
    With Cll.Range
      Do While .Characters.Last.Previous.Text Like "[ " & Chr(9) & "]"
        .Characters.Last.Previous.Text = vbNullString
      Loop
      Str = Right(Trim(Split(.Paragraphs.Last.Range.Text, vbCr)(0)), 1)
      If Str Like "[!(!)(?)(.)(:)]" Then
        If Cll.ColumnIndex = 1 Then
          .Characters.Last.InsertBefore ":"
        Else
          .Characters.Last.InsertBefore "."
        End If
      End If
    End With
  Next
Next
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