Solved

pass ADO Recordset to Excel 97 Worksheet

Posted on 1998-12-14
1
217 Views
Last Modified: 2010-05-03
I need a good method of populating data from a ADODB.Recordset into Excel97 WorkSheet.
ThanxManish
0
Comment
Question by:manish77
1 Comment
 
LVL 15

Accepted Solution

by:
Eyal earned 50 total points
ID: 1450116
Public Sub DropADORS(ByVal ADORS As ADODB.Recordset)
    Dim i As Integer, j As Integer
    Dim lCol As String, lRow As Integer
   
    For i = 0 To ADORS.RecordCount - 1
        For j = 0 To ADORS.Fields.Count - 1
            lCol = Chr(Asc("A") + j)
            Range(lCol & CStr(i + 1)).Select
            ActiveCell.FormulaR1C1 = ADORS.Fields(j).Value
        Next
        ADORS.MoveNext
    Next i
End Sub

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now