View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Brad Vontur[_2_] Brad Vontur[_2_] is offline
external usenet poster
 
Posts: 16
Default 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