OK... so I have an ADO connection to a database and I also have a named range with a list of ID's in the same worksheet where I am trying to make an ADO connection to the database. what I want to do is only pull of the data from the database where the ID is listed in the named range. If you get what I mean.
SO for example i need an ado connection which will pull of data referencing the database and the excel named range in the current worksheet:
SO for example i need an ado connection which will pull of data referencing the database and the excel named range in the current worksheet:
Code:
Set cn = New ADODB.Connection
cn.CommandTimeout = 1000
cn.Open ConnectionStringtoDB
Set rs1 = New Recordset
rs3.Open "SELECT IDField,Field1,field2,field3" & _
"FROM Table1" & _
"WHERE IDField IN(" & range([ExcelNamedRange]) & ")"
[code]
Hope you understand my problem and can help.
much appreciated,
Neemi