I was fortunate enough for finding this code relating to adding a row to the end of a table in MS Word, however I need it to add more than one row. Specifically I need it to add rows 3, 4 and 5 and all columns in those rows. Row 3 has 4 columns, row 4 has 2 columns and row 5 has 5 columns if that info is necessary.
Sub AddRow()
Dim oTable As Table
Dim oCell As Cell
Dim oPrevRow As Row, oNewRow As Row
Dim iColumn As Long
' Insert new row
Set oTable = ActiveDocument.Tables(2)
Set oPrevRow = oTable.Rows(oTable.Rows.Count)
oTable.Rows.Add
Set oNewRow = oTable.Rows(oTable.Rows.Count)
' Copy text to new row
For Each oCell In oPrevRow.Cells
iColumn = iColumn + 1
oNewRow.Cells(iColumn).Range = oPrevRow.Cells(iColumn).Range
Next
End Sub
Sub AddRow()
Dim oTable As Table
Dim oCell As Cell
Dim oPrevRow As Row, oNewRow As Row
Dim iColumn As Long
' Insert new row
Set oTable = ActiveDocument.Tables(2)
Set oPrevRow = oTable.Rows(oTable.Rows.Count)
oTable.Rows.Add
Set oNewRow = oTable.Rows(oTable.Rows.Count)
' Copy text to new row
For Each oCell In oPrevRow.Cells
iColumn = iColumn + 1
oNewRow.Cells(iColumn).Range = oPrevRow.Cells(iColumn).Range
Next
End Sub