I am trying to embed a microsoft query within an excel spreadsheet, that passes several parameters from the spreadsheet to the query. I would like the microsoft excel query function to find a few values in cells on the worksheet and pass them into the SQL code. I used this approach, but I could only understand how to pass a single parameter using the ?. I would like to pass about 3 or 4 parameters, and some of them are used in multiple places in the query. The query doesn't seem to be editable using the query builder in ms query so I wrote it in sql using a text editor.

Note: other than SQL select queries, I'm not much of a programmer so if there is a point and click way to do this (i.e. something that does not require visual basic) that would be especially helpful.

  • 1
    This is very trivial to do with VBA. Without it, I'm not sure how unfortunately. Aug 3 '11 at 23:05

You can try this in SQL view, then Excel will prompt you to select the referring cells:

where (CustomerID = ?) AND (xxx = ?) AND (zzz = ?)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.