QueryTable adding new column for Yahoo Finance query ??


New Member
Jan 27, 2005
I'll try this without adding code, I don't have it as I write this.

I picked up Excel VBA to query Yahoo Finance stock prices. I punch the excel button it works fine.
1) wanted to change the VBA to "push down" old results and add new ones
2) didn't like the code & use of cell looping - I know how to modify
3) all of a sudden the "querytable.add......" inserted an extra column into worksheet, of course everything else failed
Q1: any suggestions why
Q2: the help says querytable.add puts a new query into queries collection, are the parameters sort of frozen so I cannot issue a new query
Q3: how can I execute anURL query without adding to the collection, seems very awkward, why can't I just re-execute it
Q4: can I get a query result into a variable rather than a cell or series of cells?

Hmmm, maybe I better post some code.

**** Penny

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.


Well-known Member
Aug 21, 2005
I am not sure I have understood. however as far I visulaize the problem

why should you push down old data.
once the current data is donwloaded in sheet1. copy the data to another sheeet (first column stock names) second column-columnn B- the data copied

next time before you refresh data in sheet1. delete or celar the old data(incorporate this in the vba before refresh) and then resfresh. now this data can go into column c using vlookup function. next time it goes into column D etc etc.

so at any time sheet1 will contain the current data. sheet2 is for archival.

thank on these line if this is the problm.

Watch MrExcel Video

Forum statistics

Latest member