ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please help! Database lookup from excel (https://www.excelbanter.com/excel-programming/416060-please-help-database-lookup-excel.html)

mju

Please help! Database lookup from excel
 
I am trying to write a VBA program that will ask user to enter the company's
name in an input box.
it will then lookup an Access database to find matching company's name to
return company's ID.
ID number will be returned in an Excel spreadsheet in cell B1.Company's name
will be in cell A1.

Before Search:
Company 's name ID_Num
macy 's

After Search:

Company 's Name ID_num
macy 's 123

joel

Please help! Database lookup from excel
 
jThe best way is first ot manual do the operation while record a macro and
then modify the record macro as required.


1) From worksheet menu start recording macro - Tool - Macro Record New Macro
2) Perform the query from Data - Import External Data - New Database query.
Select the database file. then select the two Company and ID.

3) If yo can't modify the code yourself post the code so it can be modified.

"mju" wrote:

I am trying to write a VBA program that will ask user to enter the company's
name in an input box.
it will then lookup an Access database to find matching company's name to
return company's ID.
ID number will be returned in an Excel spreadsheet in cell B1.Company's name
will be in cell A1.

Before Search:
Company 's name ID_Num
macy 's

After Search:

Company 's Name ID_num
macy 's 123



All times are GMT +1. The time now is 11:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com