ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   parameter value query (https://www.excelbanter.com/excel-programming/294299-re-parameter-value-query.html)

Brad Vontur[_2_]

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


All times are GMT +1. The time now is 02:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com