XArrayDB Reference > XArrayDB Methods > DeleteColumns Method (XArrayDB) |
This method deletes count columns from an XArrayDB object starting at column index and returns the number of columns successfully deleted.
XArrayDB.DeleteColumns (index, [count])
index is a long integer specifying the index of the first column to be deleted.
count is an optional long integer specifying the number of columns to be deleted. If omitted, this argument defaults to 1.
A long integer specifying the number of columns successfully deleted.
The following example initializes an XArrayDB object with 10 rows and 6 columns, then removes the fourth and fifth columns:
MyArray(i, j) = "Row " & i & ", Col " & j
' Remove two columns starting at index 4.
result = MyArray.DeleteColumns(4, 2)
' The next line now gives a "Subscript out of range" error.