Hi,
first let me say, using such short variable names,
is no good. It might be excusable, I hope,
when the subject is just to explain the principles.
And I'm a lazy typer.
Here, in a way, "t" would be the name of the table(3)
in the document's main story. Not a real name-property, though.
Then, there is no need to create different arrays,
for each column a seperate array.
Should be possible, though, but I couldn't get it to work.
An array of arrays would be interesting, sure, but
as it is useless anyway, use a 2-dimensional array.
SI assume, there are no hardly to control
complications by split and merged cells.
So off we go:
Dim t As Table ' table
Dim c As Long ' column
Dim r As Long ' row
Dim l As Long ' just a counter
Dim s As String
Set t = ActiveDocument.Tables(3) ' the table is called "t" from now on
ReDim a(t.Rows.Count, t.Columns.Count)
' and disregard index 0 of the array
' the 2-dimensional array that holds all the data
' of an ordinary, very simple table
' now put it all into the array "a"
For r = 1 To t.Rows.Count
For c = 1 To t.Columns.Count
s = t.Cell(r, c).Range.Text
s = Left(s, Len(s) - 2) ' cut off end of cell mark
a(r, c) = s
Next
Next
' testing
c = 1 ' values from column 1
For l = 1 To t.Rows.Count
Debug.Print a(l, c)
Next
c = 3 ' values from column 3
For l = 1 To t.Rows.Count
Debug.Print a(l, c)
Next
End Sub
Greetings from Bavaria, Germany
Helmut Weber, MVP, WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"