View Single Post
 
Old 01-04-2022, 10:06 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

If the style exists in the document, then
Code:
Sub CheckTableCells()
Dim oTable As Table
Dim oCell As Cell
Dim MyRange As Range
    For Each oTable In ActiveDocument.Tables
        For Each oCell In oTable.Range.Cells
            Set MyRange = oCell.Range
            MyRange.End = MyRange.End - 1
            If Len(MyRange) = 0 Then
                MyRange.Style = ActiveDocument.Styles("standard1")
            End If
        Next oCell
    Next oTable
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote