Engineers-Excel.com

     
Engineering using Spreadsheets

Pulling Data from the web into Excel


One of my friends and ex-colleagues asked me if I could write a macro to get data from the internet into Excel. I told him that it is not needed, the feature has already been built into Excel and that it is extremely easy to use. This tip shows how it can be done.

Lets say we want to pull out data on stocks from a website, for example MSN Money into Excel. Simply go to the Data menu, choose  Import External Data and then New Web Query.

Web Query 1

In the dialog box that appears, key in the website from which you wish to get the data. A preview of the page is shown, choose the relevant data and click OK. The data is put onto the spreadsheet at the user specified range.

Refreshing the web query

The query can be refreshed to get the latest data by selecting any cell containing the queried data, right clicking it and choosing the Refresh Data option.

Refresh query