How to export data from Excel in MS Access

BizBoy

Board Regular
Joined
Jul 26, 2012
Messages
118
Hi,
Apology if my post is violating rules of the forum.
I have created a dummy data in excel, 3 columns and 5 rows (including headers).
How do I export this data in MS Access.
I was not able to locate in-built function in excel. I guess, options present are about importing data and not exporting.
Do we need to export by VBA only (do not know VBA code to export either).

Please note, I have MS Access 2010 on my machine.
Can anyone please help me in this.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Thanks Joe, am checking this and will revert with details. Have a nice day ahead. :)
 
Upvote 0
Hi,

I am using below mentioned code to export data. It seems to be working. Just checked.
Copied from below link.

https://stackoverflow.com/questions/16161865/using-excel-vba-to-export-data-to-ms-access-table

I have doubt, how to create new database, the current code requires existing database for this code to work.
Can anyone please help me in this.

Code:
Sub AccImport()
    Dim acc As New Access.Application
    acc.OpenCurrentDatabase "\\YoYo\YoYo\YoYo\My Documents\Database4.accdb"
    acc.DoCmd.TransferSpreadsheet _
            TransferType:=acImport, _
            SpreadSheetType:=acSpreadsheetTypeExcel12Xml, _
            TableName:="tblExcelImport", _
            Filename:=Application.ActiveWorkbook.FullName, _
            HasFieldNames:=True, _
            Range:="A1:C5"
    acc.CloseCurrentDatabase
    acc.Quit
    Set acc = Nothing
    MsgBox "Done !"
End Sub
 
Upvote 0
Hi Joe,

Thanks for the help. Kindly be advised, I have posted few queries at below mentioned link
https://chandoo.org/forum/threads/ms-access-query-export-excel-to-access.35988/

These includes my question about creating a new database.

I am MS Excel user, my assumption is, the way we create a new file in excel, MS Access will generate a new database (new file) for me when I want it to.
Sorry for making it confusing. Am checking the links provided by you and will revert with details.

Have a nice day ahead. :)
 
Upvote 0
Thanks for the help. Kindly be advised, I have posted few queries at below mentioned link
https://chandoo.org/forum/threads/ms...-access.35988/
Yes, if you are going to engage in Cross-Posting (posting the same question in different forums across the internet), please continue to follow our rules and be sure to mention that you are doing so and provide links to your other threads (see rule 13 here: https://www.mrexcel.com/forum/board-announcements/99490-forum-rules.html).

You have done that here, so that is good. Just be sure to also do it with all future questions that you Cross-Post.
 
Upvote 0
See my response on importing from Excel to Access at the Chandoo site which I saw before this one.
 
Upvote 0

Forum statistics

Threads
1,221,672
Messages
6,161,199
Members
451,688
Latest member
Gregs44132

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top