You can pass a parameter from a cell in the worksheet if you use VBA. Here's an example
Dim SQLStatement
Dim ConnectString
Dim MyODBCConnection
MyODBCConnection = "UsersDB"
' Open connection
' You need to set the ADO reference up in the Tools/Refence menu (Microsoft Actice X data objects Library)
Set ConnectDB = New ADODB.Connection
ConnectString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=" & MyODBCConnection
ConnectDB.Open ConnectString
' Open recordset from database table
Set rsNames = New ADODB.Recordset
rsNames.CursorLocation = adUseClient
' Use client cursor to enable AbsolutePosition property
SQLStatement = "SELECT * from testtable where NameField ='" & Cells(1, 3).Value & "'"
rsNames.Open SQLStatement, ConnectDB, adOpenStatic, adLockReadOnly, adCmdText
' Setup a counter to run down the spreadsheet rows
LineCount = 1
' Loop through returned records
Do While Not rsNames.EOF
Worksheets("Sheet1").Cells(LineCount, 1).Value = rsNames.Fields("NameField")
Worksheets("Sheet1").Cells(LineCount, 2).Value = rsNames.Fields("DetailsField")
LineCount = LineCount + 1
rsNames.MoveNext
Loop
Set ConnectDB = Nothing
Set rsNames = Nothing
Hope this helps