View Single Post
 
Old 10-22-2020, 04:32 PM
gmaxey gmaxey is offline Windows 10 Office 2016
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

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oTbl As Table
Dim oCell As Cell
Dim oRng As Range
Dim lngCount As Long
  Set oTbl = ActiveDocument.Tables(1)
  For Each oCell In oTbl.Range.Cells
    lngCount = 0
    Set oRng = oCell.Range
    With oRng.Find
      .Text = "."
      .Font.ColorIndex = wdRed
      Do While .Execute
        If Not oRng.InRange(oCell.Range) Then Exit Do
        lngCount = lngCount + 1
        oRng.Collapse wdCollapseEnd
        If lngCount > 1 Then
          oCell.Range.HighlightColorIndex = wdBrightGreen
          Exit Do
        End If
      Loop
    End With
  Next oCell
lbl_Exit:
  Exit Sub
  
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote