Export table

  • Thread starter Thread starter Luis
  • Start date Start date
L

Luis

Hello.
I have a table with more than 65535 records and i need to
export this table to an Excel file.
One of the fields on this table contains the information i
need to export to 2 diferent worksheets on thar .xls file.
What is the best way to automate this export action using
a filter to place the records on the correct worksheet
(for instance, the records with "ABC"on that field should
be exported to sheets "ABC", if the value is "DEF" then
the records should go to sheet "DEF").
 
ABC and DE
Set rst = Currentdb.OpenRecordset("Table1"

With rs
Do While not .Eo
If .Fields("FieldName") Like "*ABC*" Then
Worksheets("ABC").Range("A" & i) = .Fields("FieldName"
If .Fields("FieldName") Like "*DEF*" Then
Worksheets("DEF").Range("A" & j) = .Fields("FieldName"
.MoveNex
End if
 
Back
Top