How to Use Webtables to Import Specific Data to Excel

preview_player
Показать описание
This video covers how to import specific data from a web page when you don't want to import everything on the whole page. Use Webtables to narrow down exactly what information you want to import from the page.

Use this code:
With ActiveSheet.QueryTables.Add(Connection:="URL;" & qurl, Destination:=Range("A1"))
.WebTables = "2,3,4"
.BackgroundQuery = True
.Refresh BackgroundQuery:=False
End With

Just replace the "2,3,4" with whatever table you want to import.
Рекомендации по теме
Комментарии
Автор

Thanks for a great video!

How do you get information for the financials in the same sheet? I would like to get some of the "tables" from the income statement aswell, and by doing so making my own screener by combining both the key statistics and some of the numbers from the income state. Is this possible?

And after doing so, I quess there won't be any problem by using the index formula to present in nicely in another sheet?

Thanks!

j.h
Автор

I like it, and I will use it. Thank you!

migueldiaz-llanosros
Автор

am getting runtime error 1004. Application defined, or object defined error. Any thoughts?

michaelmerrell
Автор

I was able to do this for some data, but not all tables. I wonder how to identify the elements in the 'Inspect' feature. I'll try myself, but whilst it worked for me, I wondered why it was 'painfully slow'. Your download was fast.
You said to ask questions in the video, but I note you haven't asked any. No sense of entitlement though. :)

AndrewSheldon
Автор

How can I copy a specific data from the webtable?

Savantlam
Автор

I've tried 3 macros and only one works. every time i get an error 1004 revolving the .Refresh BackgroundQuery:=False

Jemuzu
Автор

A big thumb up for you!! This was very helpful for me. Now I can also downloade macro data from webpages like tradingeconomics.com fast and easy. But I have an question from your video. What do you do when you want data from "Summary" and the "Statistic" tab on the Yahoo financial site attached on the same sheet (e.g. Sheet1)? Do you have to make 2 seperate macros and run them for them selves, or could you add them in the same code, make an button an run it one time? Appreciate if you could explain it for us, or show this on an video. Thanks again :-)

bibl
Автор

Thanks for the great video


Is it possible to make a variable quote for the input of multiple stock names? For example you want to compare visa (V), mastercard (MA) etc.. So it will automatically change the data instead of put it in manualy:

sandervdk
Автор

How to download data from read only Excel online file

gokulakrishnansubramaniam
Автор

While opening this video showing blur...

dharamveerkumar