Hi,
I have a worksheet in Excel with more of 65000 rows and I wanna export to the other worksheet using the VBA and SQL codes, but, when come to the row number 65656, the SQL stop the consult!
I'm using the version 2007 of Excel, theoretically, this version have more of 1 million of rows, so why stop the consult?
Someone can answer my question please?
And, if answer someone, can tell how make?
The code I used is:
Dim meubd As Database
Dim minhatabela As Recordset
Set meubd = OpenDatabase(ThisWorkbook.Path & "/" & ThisWorkbook.Name, False, False, "Excel 8.0")
Set minhatabela = meubd.OpenRecordset("SELECT Empresas, E5_TIPO, E5_NATUREZ, E5_BANCO, E5_AGENCIA, E5_CONTA, E5_BENEF, E5_TIPODOC, ValorReal, E5_CLIENTE, mês, Mês2 FROM [SE05$] WHERE (Empresas='B5 - SAFIRA') AND (E5_TIPO='NF ' OR E5_TIPO='RA ') AND (E5_NATUREZ>='1001001 ' AND E5_NATUREZ<='1001013 ' or E5_NATUREZ='1004015 ') AND (E5_TIPODOC='VL' OR E5_TIPODOC='ES' OR E5_TIPODOC='RA') AND (Mês2>=40695 AND Mês2<=40695 ) ORDER BY mês;")
Plan7.Cells.ClearContents
Plan7.Range("A2").CopyFromRecordset minhatabela
meubd.Close
(I'm brazilian, so somethings are in portuguese :])
Thanks!
I have a worksheet in Excel with more of 65000 rows and I wanna export to the other worksheet using the VBA and SQL codes, but, when come to the row number 65656, the SQL stop the consult!
I'm using the version 2007 of Excel, theoretically, this version have more of 1 million of rows, so why stop the consult?
Someone can answer my question please?
And, if answer someone, can tell how make?
The code I used is:
Dim meubd As Database
Dim minhatabela As Recordset
Set meubd = OpenDatabase(ThisWorkbook.Path & "/" & ThisWorkbook.Name, False, False, "Excel 8.0")
Set minhatabela = meubd.OpenRecordset("SELECT Empresas, E5_TIPO, E5_NATUREZ, E5_BANCO, E5_AGENCIA, E5_CONTA, E5_BENEF, E5_TIPODOC, ValorReal, E5_CLIENTE, mês, Mês2 FROM [SE05$] WHERE (Empresas='B5 - SAFIRA') AND (E5_TIPO='NF ' OR E5_TIPO='RA ') AND (E5_NATUREZ>='1001001 ' AND E5_NATUREZ<='1001013 ' or E5_NATUREZ='1004015 ') AND (E5_TIPODOC='VL' OR E5_TIPODOC='ES' OR E5_TIPODOC='RA') AND (Mês2>=40695 AND Mês2<=40695 ) ORDER BY mês;")
Plan7.Cells.ClearContents
Plan7.Range("A2").CopyFromRecordset minhatabela
meubd.Close
(I'm brazilian, so somethings are in portuguese :])
Thanks!