Assuming i have this mdb:
http://www.mytempdir.com/548579
and a sheet TEST where into A2 is:OI14006 is possible to use the table into mdb to return in B2: GERVASIO CRISTOFARO
IN effect i would want to use all in vba for excel.
this is a part of code i have maked, boh?:
Sub test()
Dim cn As Object, rs As Object
Dim myReturn As Long
Const dbfullname As String = "c:\DATA\user.mdb"
Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" _
& dbfullname & ";" 'Create DB connection
Set rs = CreateObject("ADODB.Recordset")
With rs
''''
peraps here the code for matching?
''''
If Not .EOF Then Let myReturn = .fields(0)
.Close: Set rs = Nothing
End With
cn.Close: Set cn = Nothing
End Sub
http://www.mytempdir.com/548579
and a sheet TEST where into A2 is:OI14006 is possible to use the table into mdb to return in B2: GERVASIO CRISTOFARO
IN effect i would want to use all in vba for excel.
this is a part of code i have maked, boh?:
Sub test()
Dim cn As Object, rs As Object
Dim myReturn As Long
Const dbfullname As String = "c:\DATA\user.mdb"
Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" _
& dbfullname & ";" 'Create DB connection
Set rs = CreateObject("ADODB.Recordset")
With rs
''''
peraps here the code for matching?
''''
If Not .EOF Then Let myReturn = .fields(0)
.Close: Set rs = Nothing
End With
cn.Close: Set cn = Nothing
End Sub
Last edited: