How to automate a import from a webpage

V

vigfus

Aaaaaarg, i'm stuck...

I know how to make basic functions in Exel, i even made some really
complicated ones, but i think i need another approach to fix this.

I want to import a table from a webpage (easy, just make a webquery that
updates every now and then) then i want to take some of that information and
save to plot a graph, sort of like with the stockmarket.

This is my problem... i don't know how to do this. I need to copy the part i
want to keep progressiveley further away. I don't even know how to automate
the copying of one set of numbers, let alone how to make the procedure
"mobile". This is a graphic explanation of what i want to do:

http://img331.imageshack.us/my.php?image=stockmarket8zg.jpg

The red part is the raw data i can fetch automatically. The green is the
part i want to save from each dataset. You can see that i have manually
copied four parts into place and i want to keep pasting the new parts onto
the right of the green area.

Please help. If indeed this is impossible with Excel i would appreciate tips
on what software could do it.

Thank you.
 
D

Don Guillett

All you need to do is use a macro that

runs your web query (or refresh)
copies the desired data to the next column available(preferably on another
sheet)

something like this should get you started to find the column to copy to
dlc=sheets("sheet2").cells(1,columns.count).end(xltoleft).column+1
sheets("data").columns(2).copy sheets("sheet2").columns(dlc)
 
V

vigfus

Thank you for the quick answer!

Unfortunately my knowledge of macros stretches as far as to record a basic
macro. Not edit it afterwards... I have tried but failed. A more elaborate
explanaition would be nice, but i think i could manage with some link to
related information.
 
D

Don Guillett

Just put what I gave you in a sub>modify to suit your sheet names>columns,
etc or contact me privately for custom work

sub copydatatosheet2()
dlc=sheets("sheet2").cells(1,columns.count).end(xltoleft).column+1
sheets("data").columns(2).copy sheets("sheet2").columns(dlc)
end sub
 
V

vigfus

It works! Thanks!

I changed copy to cut to make it more noticeable when the macro runs. Now
that i've gotten this far i have grander goals. ;)

I still don't know how to automate the macro. I still have to be there to
start the macro. It would be neat if the macro could start automaticly when
some value appears in the raw data page (at the place i cut it from). Is this
still possible?
 
D

Don Guillett

Lazy aren't we?
As I said before, you can run your query or refresh from the macro and you
can even set up the macro to run automatically. Look in vba help index for
ONTIME
 
V

vigfus

Hehe, a little lazy i guess. ;) It's just comforting to deal with someone who
knows his stuff.

I will check the helpfiles... Once again, thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top