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.
by Allen Wyatt
(last updated January 30, 2020)
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:
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.
Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!
If you have linked information in your worksheets, you may want a way you can easily change the targets to which those ...Discover More
If you use UNC paths in your links to external information, those paths may need to be changed at some point. You can ...Discover More
When you establish links between data on a target worksheet and data on a source worksheet, those links are typically ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.