Moving Data Between Access and Excel
Moving Data Between Access and Excel
Copy data from an Excel worksheet and paste it into an Access datasheet. This is the
best process when the data exchange is temporary.
Import an Excel worksheet into an Access table. This is the best process when the data
exchange is periodic.
Link to an Excel worksheet from an Access table. (This process will be addressed in
another session.)
From Excel, you can copy data in a worksheet view and then paste the data into an Access
datasheet. If you paste data from multiple fields in a worksheet to a datasheet, make sure that
the columns match the order of the data that you want to copy.
1. Start Excel, and then open the worksheet that contains the data that you want to copy.
2. Select the rows that you want to copy.
3. On the Home tab, in the Clipboard group, click Copy.
4. Start Access, and then open the table, query, or form in which you want to paste the
rows.
5. On the Home tab, click View, and then click Datasheet View.
6. Do one of the following:
To replace records, select those records, and then on the Home tab, in the
Clipboard group, click Paste.
To append the data as new records, on the Home tab, in the Clipboard group,
click Paste Append.
Keep in mind that most failures during append operations occur because
the source data does not match the structure and field settings of the
destination table. If Paste Append does not work for you, review the
table and field properties in Design view. Make any necessary changes,
and then try appending again.
To store data from Excel in an Access database, and then use and maintain the data in Access
from then on, you can import the data. When you import data, Access stores the data in a new
or existing table without altering the data in Excel. You can import only one worksheet at a time
during an import operation. To import data from multiple worksheets, repeat the import
operation for each worksheet.
The following are common scenarios for importing Excel data into Access:
You have been using Excel, but you now want to use Access to work with this data. As
such, you want to move the data in your Excel worksheets into one or more new Access
databases.
Your department uses Access, but you occasionally receive data in Excel format that
must be merged with your Access databases. You want to import these Excel
worksheets into your database as you receive them.
You use Access to manage your data, but the weekly reports that you receive from the
rest of your team are Excel workbooks. You would like to streamline the import process
to ensure that data is imported every week at a specific time into your database.
Delete all unnecessary blank columns and blank rows in the worksheet or range.
If one or more cells in the worksheet or range contain error values, such as #NUM and
#DIV, correct them before you start the import operation.
To avoid errors during importing, ensure that each column contains the same type of
data in every row. Access scans the first eight rows to determine the data type of the
fields in the table. Also, it is a good practice to format each column in Excel and assign
a specific data format to each column before you start the import operation.
If the first row in the worksheet or named range contains the names of the columns, you
can specify that Access treat the data in the first row as field names during the import
operation.
a. To run a saved import, go to the Saved Imports button on the External Data tab.
Please note that you cannot save an Excel workbook as an Access database. Neither Excel nor
Access provides functionality to create an Access database from Excel data.
Copy data from an Access datasheet and paste it into an Excel worksheet. This is the
best process when the data exchange is temporary.
Export Access data into an Excel worksheet. This is the best process when the data
exchange is periodic.
Connect to an Access database from an Excel worksheet. (This process will be
addressed in another session.)
From Access, you can copy data from a datasheet view and then paste the data into an Excel
worksheet.
1. Start Access, and then open the table, query, or form that contains the records that you
want to copy.
2. On the Home tab, click View, and then click Datasheet View.
3. Select the records that you want to copy. On the Home tab, in the Clipboard group, click
Copy.
4. Start Excel, and then open the worksheet into which you want to paste the data.
5. Click in the upper-left corner of the worksheet area where you want the first field name
to appear. To ensure that the copied records do not replace existing records, make sure
that the worksheet has no data below or to the right of the cell that you click.
The following are common scenarios for exporting data from Access to Excel:
Your department uses both Access and Excel to work with data. You store the data in
Access databases, but you use Excel to analyze the data and to distribute the results of
your analysis. Your team currently exports data to Excel when they need to, but you
would like to make this process more efficient.
You are a long-time user of Access, but your supervisor prefers to view reports in Excel.
At regular intervals, you do the work of copying the data into Excel, but you would like
to automate this process to save yourself time.
Fields that support multiple values are exported as a list of values separated by
semicolons (;).
Graphical elements (such as logos, contents of OLE object fields, and attachments that
are part of the source data) are not exported. They will need to be added to the
worksheet manually after you complete the export operation.
Null values in the resulting worksheet are sometimes replaced by the data that should
be in the next column.
Date values earlier than January 1, 1900 are not exported. The corresponding cells in the
worksheet will contain a null value.
Expressions that are used to calculate values are not exported to Excel. Only the results
of the calculations are exported. You will need to manually add the formula after
completing the export operation.
You might see the value # in a column that corresponds to a Yes/No field in a form.
This can be the result of starting the export operation from the Navigation Pane or in
Form view. To resolve this issue, open the form in Datasheet view before exporting the
data.
1. In the source database, if you want to export only a portion of a table, query, or form,
open the object and select the records you want.
2. On the External Data tab, in the Export group, click Excel.
3. Complete the options available in the Export - Excel Spreadsheet dialog box and click
OK.
a. Enter the name for the Excel workbook.
b. Select the appropriate file format from the File Format box.
c. If you are exporting a table or a query, and you want to export formatted data,
select Export data with formatting and layout.
If you are exporting a form, this option is always selected but
unavailable (it appears dimmed).
d. To view the Excel workbook after the export operation is complete, select the
Open the destination file after the export operation is complete check box.
e. If the source object is open, and if you selected one or more records in the view
before starting the export operation, you can select Export only the selected
records. However, if you want to export all of the records displayed in the view,
leave this check box cleared. (This check box remains unavailable if no records
are selected.)
4. Access then displays a dialog box in which you can create a specification that uses the
details from the export operation. Click Yes to save the details of the export operation
for future use. Saving the details helps you repeat the same export operation in the
future without having to step through the wizard each time.
a. In the Save as box, type a name for the export specification. Type a description
in the Description box, if desired. There is also an option to create an Outlook
task to remind you to complete future exports.
b. To run a saved import, go to the Saved Exports button on the External Data tab.