VBA - Need Help To Store And Append the Data From Excel To Access

ranjith2523

Board Regular
Joined
Apr 29, 2014
Messages
137
Office Version
  1. 365
Hi Friends,

I am using Microsoft Office 365.

I need your help to store and append the data from Excel to Access using Excel VBA. I have created an Excel File and Access file with the same headers and I require that the data be moved to excel to access when I click a button. Once it is been pushed, If I add new data in excel and click the button then the data to be appended in Access. Simply I need to store the data in MS Access and I would like to use VBA code to do that.

I am not familiar with VBA Coding to work with the Access database but still, I spent a day to google and tried something like beginning with the below coding but I was not able to achieve it.

Dim dbCon As New ADODB.Connection
Dim dbCommand As New ADODB.Command

dbCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sdbpath & "; Jet OLEDB:Database Password=;"


Excel Sheet Name "Data"
View attachment 52111

Created Table In MS Access (File name - Access.accdb)

View attachment 52112

Can someone please help me with this?

Regards,
Ranjith
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi Friends,

I am using Microsoft Office 365.

I need your help to store and append the data from Excel to Access using Excel VBA. I have created an Excel File and Access file with the same headers and I require that the data be moved to excel to access when I click a button. Once it is been pushed, If I add new data in excel and click the button then the data to be appended in Access. Simply I need to store the data in MS Access and I would like to use VBA code to do that.

I am not familiar with VBA Coding to work with the Access database but still, I spent a day to google and tried something like beginning with the below coding but I was not able to achieve it.

Dim dbCon As New ADODB.Connection
Dim dbCommand As New ADODB.Command

dbCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sdbpath & "; Jet OLEDB:Database Password=;"


Excel Sheet Name "Data"
View attachment 52111

Created Table In MS Access (File name - Access.accdb)

View attachment 52112

Can someone please help me with this?

Regards,
Ranjith
Can someone help me on this query please...
 
Upvote 0

Forum statistics

Threads
1,212,927
Messages
6,110,733
Members
448,294
Latest member
jmjmjmjmjmjm

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