Is this query an MSQuery originating in Excel, or is it an Access query that you use to filter the data?
If it's Access, you can use variables if you turn the query into a SQL statement but we need to see what you have before giving any detailed help.
Go to the SQL view of the query, copy the code, and post it to the board
If it's Excel, consider using ADO code to push the data to Access. That way you can use cell values as your parameters to pull data from Access, or to filter data prior to exporting it.
Denis