parameter value query
You can make a querytable using the MS Query tool that reads your data just like you want. Hard code the parameters for now
Using VBA, you can edit the CommandText property of the QueryTable object to modify the criteria, then just refresh it as necessary
Another option would be to use ADO. You can read your data directly from the database using a dynamic select statement and use the Range object's CopyFromRecordset method to populate your spreadsheet
HTH
-Brad
|