Quote Originally Posted by Erwin69 View Post
When working with sets of data, there is for example the Recordset.GetRows feature to quickly move all data retrieved from a database into an array. For exporting to Excel there is the Range.Resize function to quickly move the data from an array into a worksheet.

I guess the VBFlexGrid control offers such features as well, but haven't figured it out yet. If it indeed does, can you give me some pointers on how to do that?
Update released.

Included the CopyFromRecordset function which copies the contents of an ADO or DAO Recordset onto the flex grid.
It works like the Excel function which returns the number of fetched records and copies from the current position to EOF.
The number of maximum rows and columns can be specified.
If omitted it is maximum remaining rows and columns that the grid can receive relative to the destination starting point.
The grid will not grow and it just ignores the overflow of rows and columns. (like Excel)
The destination row/col can be specified where the pasting onto the flex grid starts.
If omitted it is the first non-fixed row and first non-fixed column.

VBFlexGrid
Public Function CopyFromRecordset(Data As Object, [ByVal Rows As Long = -1], [ByVal Cols As Long = -1], [ByVal Row As Long = -1], [ByVal Col As Long = -1]) As Long

Excel
Function CopyFromRecordset(Data As Unknown, [MaxRows], [MaxColumns]) As Long