• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA to extract matching data from Access

I have a list of ID numbers in column A of a spreadsheet. I have an Access Query called Billing Details. In this query, "co" matches the ID numbers in column A of the spreadsheet.

What I want to do is have VBA in the spreadsheet loop through each ID number and return all the data associated with that ID number from Access in Excel. Basically, the macro would be pulling the matching billing details from Access and putting them into the spreadsheet.

I do not have much knowledge of doing something like this so any help or a point in the right direction would be very helpful.

Thank you very much.
 
Hi:

  • Link the excel sheet with list of ID numbers to access.
  • Run a select query linking this excel sheet with your main access data base. (this query will basically pull data you want).
  • Link it back to the excel using data wizard in a different excel tab.
You can do this without any vba code. However, if you want to avoid the manual step of running access queries, you can use vba code to remotely run the access query without opening the access.

Thanks
 
Back
Top