Hey guys,
First and foremost, I need to say a big thank you to this community. Been a silent reader most of the time, but you have no idea how helpful you've been so far for this project of mine. So a big thumb up to every single one of you.
Now to be honest, VBA still looks like chinese to me most of the time. Sometimes I feel like I understand what I'm doing, then everything falls apart and I realize that I do not. This is one of those case where I have absolutely no idea how to edit the code I have, so that it'll react the way I'm looking for. And not quite sure where to start my research. Not even sure if it's just a simple tweak, or something that would take days to edit.
Now I understand how specific my problem is, so feel free to completely disregard this topic if you feel like this is way too big of a task to be discussed here. But if you have any pointers whatsoever, I'll be all eyes and all ears.
Here's the deal.
I have this tab, called 'GET - Investing' in which I'd like to retrieve very specific data from a bunch of different pages (all with the exact same layout) of Investing.com website. The layout of this tab goes as follow;
Column A = Symbols (manually entered by the user, it's just a reference that I'll use later on for a VLOOKUP on my report sheet)
Column B = URLs (manually entered by the user, to determine the pages we need)
*These two columns don't need any changes, or to be affected by the macro.
Column C = Moving Average Text (Data from website - Strong Buy, Buy, Neutral, Sell or Strong Sell)
Column D = Moving Average "Buy" (Data from website - Numerical value from 1 to 12)
Column E = Moving Average "Sell" (Data from website - Numerical value from 1 to 12)
Column F = Technical Indicator Text (Data from website - Strong Buy, Buy, Neutral, Sell or Strong Sell)
Column G = Technical Indicator "Buy" (Data from website - Numerical value from 1 to 12)
Column H = Technical Indicator "Sell" (Data from website - Numerical value from 1 to 12)
Column I = Formula to calculate the number of "Neutral" technical indicators, doesn't need to be touched
Now, someone here (Hey Rkey !) has been kind enough to give me a code that seems to retrieve exactly the infos that I need. The results on the Debug.Print screen are precisely what I'm looking for. The VBA code is:
Debug Screen shows the following...Please Login or Register to view this content.
I just don't know what to do with these results now. Tried a couple of things, but being the newbie that I am, nothing seems to work. So what I'm looking for basically is...Please Login or Register to view this content.
a) Instead of a fixed URL, contained within the VBA code itself, is there a way to use the URL contained in Column B (starts at B3) to retrieve the same infos from that page ? I'm pretty sure it's a simple change at the beginning of the macro, but have no idea what the syntax would be.
b) How do I assign the results to the correct cell, on the same line. Bascially, say the URL is in B3, how do I transfer the "Strong Sell" indicator to C3, "maBuy" to D3, "maSell" to E3, and so on...
c) Then at the end, how do I loop this routine, so that it will start from the URL contained in B3, and go down the list for B4, B5, B6, applying the correct results for each, on the appropriate line (so B4 results to C4 through H4, B5 results to C5 through H5)...and loop that routine until there's no more URL in column B to be treated ?
I have something that works right now, but it's an entirely different way of doing it, and it takes up to 10 minutes to retrieve that data from 57 pages...mainly because (well, I think) it copies the whole page instead of extracting the portion of data I need. Which is why I went back to this macro, because I have a feeling it might make things a lot faster. But it's SO above my level...
So if you feel like helping me out, I'll be forever grateful. If not, I still like you...like I said, most of you have been very helpful already.
A silent reader in need of help.
KJ
Bookmarks