+ Reply to Thread
Results 1 to 2 of 2

CopyFromRecordset

  1. #1
    Registered User
    Join Date
    09-12-2008
    Location
    Melbourne
    Posts
    2

    CopyFromRecordset

    Hi All,

    Im using the following code to get data into a recordset (successfully) - But because i often recieve more than 1 record, the recordset fills in each row beneath the cell which is referenced.

    Because the program is looking at a reference cell in each row, the recordset, when more the 1 is returned from the previous call now gets overwritten.

    I would like to have each record go across the columns instead, but i can't figure out what to change in this code to make it work?

    Eg: I'm trying to retrieve 3 fields to put into Columns C, D & E. If I return 2 records, i want the 2nd record to go into Columns F, G & H.

    Hope i've explained this OK?? Excel 2003.

    Can anybody offer up a solution?

    Cheers All,

    Bam.

    Please Login or Register  to view this content.
    Last edited by bamma; 06-17-2010 at 09:31 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: CopyFromRecordset

    One way might be to push the recordset into a Variant Array and iterate accordingly.
    With each iteration the "paste cell" is set to be the first empty column from the right for the row as determined by the passed range.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1