Fill Array from every 2nd Column in Word Table
Hi, I am trying to fill an array from a Word Table but only use values from every second column but starting from column 1 then skip the second column and add value from 3rd column and so on.
Code:
Public Function FillArray()
Dim myArray() As String
Dim i As Long
Dim j As Long
Dim pRow As Long
Dim oTbl As Word.Table
Set oTbl = ActiveDocument.Tables(3)
ReDim myArray(oTbl.Rows.Count - 3, oTbl.Columns.Count - 1)
For i = 0 To UBound(myArray, 1)
For j = 0 To UBound(myArray, 2)
myArray(i, j) = Left(oTbl.Cell(i + 2, j + 1), Len(oTbl.Cell(i + 2, j + 1).Range.Text) - 2)
Next
Next
FillArray = myArray
End Function