XArrayDB Reference > XArrayDB Methods > InsertColumns Method (XArrayDB) |
Inserts new columns into an array object.
XArrayDB.InsertColumns (index, [count])
index is a long integer specifying the index of the first column to be inserted.
count is an optional long integer specifying the number of columns to be inserted. If omitted, this argument defaults to 1.
A long integer specifying the number of columns successfully inserted.
This method inserts count columns into an XArrayDB object starting at column index and returns the number of columns successfully inserted.
The following example initializes an XArrayDB object with 10 rows and 6 columns, then inserts a new column before the fourth column:
MyArray(i, j) = "Row " & i & ", Col " & j
' Insert a new column at index 4.
result = MyArray.InsertColumns(4)
Debug.Print IsEmpty(MyArray(1, 4))