Perform Web Queries

Web queries are a quick way to import data from a web page into a worksheet using a QueryTable object. To perform a web query:

  1. From the Data menu, choose Import External Data, then choose New Web Query. Excel displays the Edit Web Query dialog shown in Figure 24-1.

    Use web queries to import data directly from a web page

    Figure 24-1. Use web queries to import data directly from a web page

  2. Type the address of the web page you want to import data from in the Address bar and click Go to navigate to that page. It is usually easiest to find the page you want in your browser, then cut and paste that address into the Edit Web Query dialog box.

  3. Excel places small yellow boxes next to the items you can import from the page. Click on the item or items you want to import and Excel changes the yellow box to a green check mark.

  4. Click the Options button to set how Excel formats imported items. Formatting options are shown in Figure 24-2.

  5. Close the Options dialog box and click Import. Excel displays the Import Data dialog box shown in Figure 24-3.

    Set formatting options for the query

    Figure 24-2. Set formatting options for the query

    Choose the destination for the imported data

    Figure 24-3. Choose the destination for the imported data

  6. Click Properties to determine how the query is performed, such as how the data is refreshed. ...

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.