Sub ADOTest()
Dim i As Integer, query As String
Application.ScreenUpdating = False
For i = 4 To 16
query = query + "select f1,f2,'" & Sheets("Nguon").Cells(2, i) & "',f" & i & " from [Nguon$A4:P273]" & Chr(10) & "union all " & Chr(10)
Next
query = Left(query, Len(query) - 11)
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
With cn
.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ThisWorkbook.FullName & ";Extended Properties=""Excel 12.0 Xml;HDR=NO;IMEX=1"";"
.Open
End With
rs.Open query, cn
Range("F4").CopyFromRecordset rs
rs.Close: cn.Close: Set rs = Nothing: Set cn = Nothing
Application.ScreenUpdating = True
End Sub