View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Excel Lookup in Access

No code, so I don't know how you are trying to do this. But with an ADO
connection and .execute some SQL in a loop.
SQL="UPDATE Devices SET Description=" & Chr(34) & Cells(2,Counter) & chr(34)
& " WHERE Acronym=" & Chr(34) & Cells(1,Counter) & Chr(34)
Trap the error if the update fails.

Or you can try a BatchUpdate of a recordset from the original data.

NickHK

"Romefucan" wrote in message
...
What I have is this situation (in its simplest form)
I have an MS Access Database called Device Signals.mdb with a table called
"Devices" that contains 3 Fields (Primary Key, Acronym, Description).

There
are 160,000 records in the database. Example of a worse case acronym in

the
Acronym Field is L30_LST.SWI. The Description Field is simply the text
description of the Acronym. Both fields are formatted as text in MS

Access.

In Excel I have a single spreadsheet I call (Sheet 1). Sheet 1 has 2 Rows.
The 2 rows can sometimes be 200 columns wide. Row 1 is Acronyms pasted

from
field data, which is never in the same order. Row 2 is a place-holder for

the
Descriptions.

What I need is some code (similar to VLOOKUP in Excel) to scan Row 1, got

to
the Access database lookup the Acronyms in the "Acronyms Field" in Access

and
copy the descriptions from the "Descriptions Field" into Row 2 of my Excel
Spreadsheet under the correct Acronym.
I have tried numerous versions of code without success, some work on
numbers, others on text, but none thus far have worked on alpha-numeric

data
also taking into account spaces.

Can anyone Help

Thanks in advance

Romefucan