| | Help by Product How-to Resources Support and Feedback Technical Resources Additional Resources Get Office 2007 | Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.
Customize a parameter query
Parameter queries must be created in Microsoft Query. For more information about creating parameter queries, see Microsoft Query Help. Change the custom prompt for a parameter query
- In Microsoft Excel, click a cell anywhere in the external data range (external data range: A range of data that is brought into a worksheet but that originates outside of Excel, such as in a database or text file. In Excel, you can format the data or use it in calculations as you would any other data.) created with a parameter query (parameter query: A type of query that, when you run it, prompts for values (criteria) to use to select the records for the result set so that the same query can be used to retrieve different result sets.).
- On the External Data
toolbar (toolbar: A bar with buttons and options that you use to carry out commands. To display a toolbar, click Customize on the Tools menu, and then click the Toolbars tab.), click Query Parameters
.
- In the list on the left side of the Parameters dialog box, click the parameter that you want to change.
- In the Prompt for value using the following string box, type the text that you want to use for the prompt, and then click OK. The custom prompt can contain up to 100 characters.
- To use the new custom prompt and refresh (refresh: To update data from an external data source. Each time you refresh data, you see the most recent version of the information in the database, including any changes that were made to the data.) the data, click Refresh Data
on the External Data toolbar.
Note This procedure changes the custom prompt only for the current session of the workbook. If you want to permanently save your changes to the custom prompt, save the workbook or change the prompt for the query (query: In Query or Access, a means of finding the records that answer a particular question you ask about the data stored in a database.) in Microsoft Query. For more information about changing a query, see Microsoft Query Help.
Use data from a cell as a parameter value
- On your worksheet, type the values you want to use as criteria (criteria: Conditions you specify to limit which records are included in the result set of a query or filter.) in the query (query: In Query or Access, a means of finding the records that answer a particular question you ask about the data stored in a database.).
- Click a cell anywhere in the external data range (external data range: A range of data that is brought into a worksheet but that originates outside of Excel, such as in a database or text file. In Excel, you can format the data or use it in calculations as you would any other data.) created with a parameter query (parameter query: A type of query that, when you run it, prompts for values (criteria) to use to select the records for the result set so that the same query can be used to retrieve different result sets.).
- On the External Data
toolbar (toolbar: A bar with buttons and options that you use to carry out commands. To display a toolbar, click Customize on the Tools menu, and then click the Toolbars tab.), click Query Parameters
.
- In the list on the left side of the Parameters dialog box, click the parameter you want to change.
- Click Get the value from the following cell.
- On the worksheet, click the cell that contains the value you want to use.
If you want to refresh (refresh: To update data from an external data source. Each time you refresh data, you see the most recent version of the information in the database, including any changes that were made to the data.) the data whenever you change the value in the cell, select the Refresh automatically when cell value changes check box.
- Click OK.
- To refresh the data, click Refresh Data
on the External Data toolbar.
Use a constant parameter value for a query
- In Excel, click a cell in the external data range (external data range: A range of data that is brought into a worksheet but that originates outside of Excel, such as in a database or text file. In Excel, you can format the data or use it in calculations as you would any other data.) created with a parameter query (parameter query: A type of query that, when you run it, prompts for values (criteria) to use to select the records for the result set so that the same query can be used to retrieve different result sets.).
- On the External Data
toolbar (toolbar: A bar with buttons and options that you use to carry out commands. To display a toolbar, click Customize on the Tools menu, and then click the Toolbars tab.), click Query Parameters
.
- In the list on the left side of the Parameters dialog box, click the parameter you want to change.
- Click Use the following value.
- Type the value you want to use for the parameter, and then click OK.
- To refresh (refresh: To update data from an external data source. Each time you refresh data, you see the most recent version of the information in the database, including any changes that were made to the data.) the data, click Refresh Data
on the External Data toolbar.
|