Sub ADO()
Dim strDB As String, strSQL As String
Dim i As Long, n As Long, lFieldCount As Long
Dim rng As Range
Dim adoRecSet As New ADODB.Recordset
Dim connDB As New ADODB.Connection
Dim ws As Worksheet
Set ws = ActiveWorkbook.Sheets("sheet1")
Set adoRecSet = New ADODB.Recordset
strSQL = "SELECT Code FROM Stock WHERE Price > 100"
adoRecSet.Open Source:=strSQL, ActiveConnection:=connDB, CursorType:=adOpenDynamic, LockType:=adLockOptimistic
Set rng = ws.Range("A1")
lFieldCount = adoRecSet.Fields.Count
For i = 0 To lFieldCount - 1
rng.Offset(0, i).Value = adoRecSet.Fields(i).Name
Next i
rng.Offset(1, 0).CopyFromRecordset adoRecSet
Range(ws.Columns(1), ws.Columns(lFieldCount)).AutoFit
adoRecSet.Close
connDB.Close
Set adoRecSet = Nothing
Set connDB = Nothing
End Sub