ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ms query editor question (https://www.excelbanter.com/excel-programming/428606-ms-query-editor-question.html)

Joseph Atie

ms query editor question
 
Is there a way to use a cells from an excel sheet as a parameter in an ms
query editor query?

i assume i could do it using vba by changing the query before i run the script

is there a better way / a way to do it from ms query.

I tried using a cell reference but ms query would not accept it

i.e =Interface!B5

Thanks in advance

Joseph Atie

Jacob Skaria

ms query editor question
 
Get the value to a variable and use that within your query.

Dim varTemp as variant

varTemp = Workbooks("<bookname").Sheets("Interface").Range( "B5")

If this post helps click Yes
---------------
Jacob Skaria


"Joseph Atie" wrote:

Is there a way to use a cells from an excel sheet as a parameter in an ms
query editor query?

i assume i could do it using vba by changing the query before i run the script

is there a better way / a way to do it from ms query.

I tried using a cell reference but ms query would not accept it

i.e =Interface!B5

Thanks in advance

Joseph Atie


FSt1

ms query editor question
 
hi
assuming that you have a parameter query already, right click the query
range and from the popup, click parameters. a parameter dialog with 3 options
will appear.
1. prompt for input ie input box
2. use a fixed value
3 use value from the following cell.

you want option 3.

if the parameter icon on the popup is grayed out, this means you don't have
a parameter query yet and you must set one up first. the logic (i think) is
that you can't edit a parameter query until you have a parameter query to
edit.

post back if you have more questions.

Regards
FSt1

"Joseph Atie" wrote:

Is there a way to use a cells from an excel sheet as a parameter in an ms
query editor query?

i assume i could do it using vba by changing the query before i run the script

is there a better way / a way to do it from ms query.

I tried using a cell reference but ms query would not accept it

i.e =Interface!B5

Thanks in advance

Joseph Atie



All times are GMT +1. The time now is 10:16 AM.

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