Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Pulling Access Information into Excel.
Written by Allen Wyatt (last updated November 22, 2024)
This tip applies to Excel 2007, 2010, 2013, and 2016
Moss built an Access database of his customers, and he uses Excel for the invoicing. He wonders if there is a way to populate the customer information fields in the Excel invoice automatically from the Access database.
There are a few ways you can approach this task, and each method has plusses and minuses. A relatively simple approach is (obviously) to forego Excel altogether and simply do everything in Access. Simple invoices could be created using forms, and then your data doesn't need to travel between programs.
If you prefer to do the invoice in Excel, then you could create a link in Excel to a query in Access. You create a new query by following these general steps:
With the Access data now in your worksheet, you can access the imported information, from your invoice, using formulas that utilize various lookup functions. The imported information is refreshed each time you open the workbook.
Another approach is to develop your own set of VBA macros to grab the information from the Access database. This is not a trivial task, as it involves knowing how to access, via VBA, objects in both Excel and Access. You'll also need to know how to put together SQL statements to extract only the data you want from the database. The upside of slogging through creating the macros is that they provide the most flexibility possible in grabbing data and manipulating it.
Creating the exact macros you need is beyond the scope of this simple tip. You can find more information by getting a few good VBA programming books (make sure you get one specifically for Access as one of the books). The websites available at the Access MVP site may also be helpful:
http://www.mvps.org/links.html#Access
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11843) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Pulling Access Information into Excel.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
If you have links in your workbook to data in other workbooks, you may want to control whether Excel updates those links ...
Discover MoreCombining workbooks that have cross-links to each other can offer some special challenges. This tip examines how you can ...
Discover MoreWhen you copy workbooks that contain links, you may be at a loss as to how to update those links. There are a couple of ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2016-07-26 11:31:39
Judy
Jeff - what is Power Query?
Thanks
2016-07-25 10:03:25
Dave S
If doing this infrequently, may be easier to import from Excel into Access using Access' External data functionality. Or, you can cut and paste data from Excel into an open Access table (making sure data types of source column and destination field correspond). Otherwise, the Excel vba route is an option, by which a link is made to a database using either DAO or ADO - an internet search will locate example code.
2016-07-25 09:34:12
Jeff Starr
You should be discussing Power Query as one of the options, if not the preferred one! It's powerful, fantastic and provides an ongoing link to the data!
2016-07-25 09:33:44
Henry Arthur
Michael
It is the same operation in reverse. In Access go to the 'External Data' tab and choose the 'Excel' option in the 'Import and Link' group. Follow the instructions from there.
Make sure your Excel worksheet data has row 1 as the headings you want for field names, or use named ranges which Access can find easily.
Henry
2016-07-25 02:26:03
Michael Williams
How can I export excel data to Access ?
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments