Sub WriteHeaderToRange(ByVal adoRecSet As ADODB.Recordset, ByVal startCell As Range)
'Description: Writes the header of a Recordset to a Range
'Input: Recordset object; Start cell (Range)
'****** DEKLARÁCIÓK ********************
Dim i As Long
'*******************************************
' If startCell contains more cells then upper-left cell is used
If startCell.Cells.Count > 1 Then startCell = startCell.Cells(1)
For i = 0 To adoRecSet.Fields.Count - 1
'name of field(column):
startCell.Offset(0, i).Value = adoRecSet.Fields(i).Name
Next i
End Sub