Record Set To Sheet

G

Guest

I am wondering the easy way to take data retrieved from a database, which is
now sitting in a record set, and place that data into the sheet. Do I need
to itterate through the record set and navigate cell by cell of my sheet, or
is there a quicker way to get all the data loaded into a specific area of my
sheet>

Thanks in advance for your assistance!!
 
G

Guest

Hi

Use the CopyFromRecorset method of the Range object.
Say you want to paste your recordset starting in A1:
Dim Rst as adodb.recordset
...
Range("A1").CopyFromRecordset Rst

done!
The syntax is Range.CopyFromRecorset Recordset, MaxRows, MaxColumns
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top