Dear helpful forum members,
I am trying to use ADO via VB6 to find a specific input in row A of my excel sheet.
I then want it to return the Column and Row to me separately.
I'm having a huge problem finding any precise information on how to do this.
I have a code I already use for returning specific values from cells:
Now I want something like this I can use as a function, but it obviously needs tweaks.
Could anyone assist me in this matter?
As always, thank you very much.
Jerome
I am trying to use ADO via VB6 to find a specific input in row A of my excel sheet.
I then want it to return the Column and Row to me separately.
I'm having a huge problem finding any precise information on how to do this.
I have a code I already use for returning specific values from cells:
Code:
Function Look(ClosedWorkbookFullName As String, _
SheetName As String, RangeAddress As String) As Variant
Dim conn As Object, rs As Object, SQL As String
Set conn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & ClosedWorkbookFullName & _
";Extended Properties=""Excel 8.0;HDR=NO;"""
SQL = "Select * From [" & SheetName & "$" & RangeAddress & ":" & RangeAddress & "]"
rs.Open SQL, conn, 1, 3
Look = rs.Fields(0).Value
rs.Close: conn.Close
If IsNull(Look) Then Look = ""
End Function
Now I want something like this I can use as a function, but it obviously needs tweaks.
Could anyone assist me in this matter?
As always, thank you very much.
Jerome