Is there a way to autofill Excel cells with data from an Access Database?
Basically I have a lot of historical data, consisting of IPs, Contacts, and various other fields. Originally we kept all this data in an Excel spreadsheet. I recently created an Access Database with this historical data. Now I am wondering if there is any way to use VBA or something else to autofill fields in the Excel spreadsheet using data from the Access database. Example, I pu开发者_如何学Ct in an IP Address and a search is done for matches in the database and the Contacts field is filled out automatically. If anyone has an idea on this please let me know.
EDIT: What I'm trying to do is have the field auto-populate with the information from the Access database when I fill in the cell in the Source IP column in the spreadsheet. I import these IPs in a csv file and paste them into the spreadsheet. We have to add anywhere from 10-100 IPs and I'm not wanting to run a Query on each individual one. I'm wanting to automate the process we have right now, so basically I cut and paste, a macro or something runs and the remaining fields auto-populate with the data that's in Access. Edit/Delete Message
It sounds as though you need to write an Excel macro to retrieve data from your Access database, based on data (eg. IP Address) already entered into the spreadsheet.
EDIT: if I understand the edited question correctly, it sounds as though all the database values will have already been pasted into the spreadsheet, so that it won't be necessary to re-query the database. In which case, the contacts field can be populated using the Excel VLOOKUP function.
Could you provide some more information, I do not understand your question.
You have imported your information into your database, surely you just need to run a query which will display what you need. There does not seem to be any data manipulation required here at all, VBA or otherwise.
Set your IP address to your primary key, and use it to link into your other tables?
Reply back here with some more information and I will try to help further.
EDIT due to more information, I would consider importing Excel to Access and not the other way around, this will be much more manageable and will allow greater flexability.
Import Excel sheet to access with the above code, play about in there by linking PK's then export back out to Excel for your users
精彩评论