Jugulator
8/12/2018 - 11:00 AM

Write Recordset To Range

Sub WriteRecordsetToRange(ByVal adoRecSet As ADODB.Recordset, ByVal startCell As Range)
'Description:   Writes data from a recordset to a range
'Input:         Recordset object; start cell (Range)

'   if startCell contains more than one cell then upper-left cell is used
    If startCell.Cells.Count > 1 Then startCell = startCell.Cells(1)
    
    startCell.CopyFromRecordset adoRecSet
    
End Sub