VB Script/Import from Excel to Access 2010
I have :
- Access database called Dosimetry.
- A table within called ReadingResult
- An Excel file called MicroStar that contains one sheet called Sheet1 (5 columns)
- I need a VBA script that I can run when clicking a command button. This script should import the content of Sheet1 to ReadingResult table.
There are multiple ways to import excel data into Access table. You can do this using Excel VBA or by using Access forms code. Here is excel VBA example:
You can try with below code, please ensure your filenames, its path are correct. I have considered column A to E (5 columns) and 9 rows (Row #2 to Row10) for import from excel to Access.
Dim acc As New Access.Application
Set acc = Nothing