18.11.2014 Views

Microsoft Office

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Part V<br />

Analyzing Data with Excel<br />

Fortunately, Excel saves the query definition with the workbook. Simply move the cell pointer anywhere<br />

within the external data table in the worksheet and then use one of the following methods to refresh the<br />

query:<br />

n<br />

n<br />

n<br />

Right-click and choose Refresh from the shortcut menu.<br />

Choose Data ➪ Manage Connections ➪ Refresh All.<br />

Click Refresh in the Workbook Connections dialog box (displayed by choosing Data ➪ Manage<br />

Connections ➪ Connections).<br />

Excel uses your original query to bring in the current data from the external database.<br />

TIP<br />

If you find that refreshing the query causes undesirable results, use Excel’s Undo feature to<br />

“unrefresh” the data.<br />

A single workbook can hold as many external data ranges as you need. Excel gives each query<br />

a unique name, and you can work with each query independently. Excel automatically keeps<br />

track of the query that produces each external data range.<br />

NOTE<br />

After performing a query, you may want to copy or move the external data range, which you<br />

can do by using the normal copy, cut, and paste techniques. However, make sure that you<br />

copy or cut the entire external data range — otherwise, the underlying query is not copied, and the copied<br />

data can’t be refreshed.<br />

CAUTION<br />

Deleting a query<br />

If you decide that you no longer need the data returned by a query, you can delete it by selecting the entire<br />

external data range and pressing Delete. Excel displays a warning and asks you to verify your intentions.<br />

Changing your query<br />

If you bring the query results into your worksheet and discover that you don’t have what you want, you can<br />

modify the query. Move the cell pointer anywhere within the external data table in the worksheet. Rightclick<br />

and choose Table ➪ Edit Query from the shortcut menu. You need to edit the query using <strong>Microsoft</strong><br />

Query. See the next section to learn how to work with Query directly.<br />

Using Query Without the Wizard<br />

When you choose Data ➪ Get External Data ➪ From Other Sources ➪ From <strong>Microsoft</strong> Query, the Choose<br />

Data Source dialog box gives you the option of whether to use Query Wizard to create your query. If you<br />

choose not to use Query Wizard, <strong>Microsoft</strong> Query is launched in a new window. You also work directly<br />

with Query if you choose to edit a query that was created with Query Wizard.<br />

NOTE<br />

<strong>Microsoft</strong> Query is a relatively old application, and its user interface hasn’t been updated to<br />

match the other <strong>Office</strong> 2007 programs. It works fine. It just looks old-fashioned.<br />

Creating a query manually<br />

Before you can create a query, you must display the Criteria pane. In Query, open the View menu and place<br />

a check next to the Criteria command. The Criteria pane appears in the middle of the window. Figure 33.13<br />

shows <strong>Microsoft</strong> Query, after selecting the Budget Database from Excel’s Choose Data Source dialog box.<br />

The Criteria pane also appears.<br />

586

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!