Import Excell Format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have been trying to import four sheets from a workbook and it was not
working until i placed all columns in the sheets exactly in the same order as
the main table. It was imported into a new table and i did a copy paste in
which the results filled up the other two tables correctly. This seems so
manual..Is there another way beside formating all the sheets?
 
Link to Excel (as opposed to importing), then use Append queries based on
the linked tables to populate the real table(s).
 
You can use code to rename the field names... DAO 3.6 reference elevated
above ADO...

Public Sub subTest()
Dim db As Database
Dim tdfTable As TableDef
Dim flds As Fields
Dim fld As Field

Set db = CurrentDb
Set tdfTable = db.TableDefs("tblTest")
Set flds = tdfTable.Fields

For Each fld In flds
Debug.Print fld.Name
Next
End Sub
 
Back
Top