|
试过ado 最快也需要60秒以上!!
Dim cnn As New Connection
Dim rs As New Recordset
Dim rs1 As New Recordset
Dim sql As String
Dim sql1 As String
Dim x%
cnn.Open "provider=Microsoft.ACE.OLEDB.12.0;extended properties=excel 12.0;data source=" & ThisWorkbook.Path & "\" & "原始库.xlsx"
sql = "select * from [Sheet1$b1:b990000" & "] "
rs.Open sql, cnn
sql1 = "select * from [Sheet1$m1:m990000" & "] "
rs1.Open sql1, cnn
Sheet2.Range("A2").Offset(0, 0).CopyFromRecordset rs
Sheet2.Range("b2").Offset(0, 0).CopyFromRecordset rs1
rs.Close
rs1.Close
cnn.Close
各位高手 看看是否有更快的方法 期待奇迹!!!
|
|