View Single Post
 
Old 08-04-2016, 05:13 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
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 of
Default

Without access to your process to change the part of the code that writes to the cell to replace the cell content rather than add to it, a pre-filled table is not going to be easy to achieve. The best I can manage for the moment is to fill the empty cells using a Word macro.
Code:
Sub FillTable()
Dim oTable As Table
Dim oCell As Cell
Dim oRng As Range
Dim i As Long
    If Not ActiveDocument.Tables.Count = 1 Then
        MsgBox "Invalid Document"
        GoTo lbl_Exit
    End If
    Set oTable = ActiveDocument.Tables(1)
    If Not oTable.Rows.Count = 13 Then   'the number of rows in the table
        MsgBox "Invalid Document - Row count = " & oTable.Rows.Count
        GoTo lbl_Exit
    End If
    For i = oTable.Range.Cells.Count To 1 Step -1
        Set oCell = oTable.Range.Cells(i)
        If Len(oCell.Range) = 2 Then
            Set oRng = oCell.Range
            oRng.End = oRng.End - 1
            oRng.Text = "....................."    'to fill the length of the cell
        End If
    Next i
lbl_Exit:
    Exit Sub
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