Table Property: Data 

Purpose

Accesses (sets or gets) Table object data as if it were an array.

Description

The Data property copies data quickly between an array and a Table object. For example, this property can be used to fill an Excel Range or as a return value of a Visual Basic function. Used as a get operation, the Data property gets the data from a Table object and returns it in safe-array form:

MyArray = MyTable.Data

Used as a set operation, the Data property takes data from an array and loads it in the Table object:

MyTable.Data = MyArray

If you use the Data property as a set operation, and the provided array contains more rows than the table actually has, the table is resized automatically. The table is always filled starting in cell (1,1). If you want to start with a different left upper corner, use the Range object.

If you copy an array to a Table object, and the array has more columns than the table, Column objects will not be added automatically to the Columns collection.