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 July 23, 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:
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.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!
Copying information from one place to another in a worksheet is easy. Copying hyperlinks may not seem that easy, but you ...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
Need to get rid of hyperlinks in a worksheet? Here's an easy way to do it without using a macro.Discover More
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.