Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

pass ADO Recordset to Excel 97 Worksheet

Posted on 1998-12-14
1
Medium Priority
?
236 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 100 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

916 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