I am trying to make a web query macro that will run multiple queries (for now I am testing it on a smaller project that is probably just as fast to do it by hand as to figure it out, but later I will be doing it on excel spreadsheets with tens of thousands of rows, if it takes a few minutes to run, that is no problem, as it will only need to really be run once on those ones, just as long as it doesnt run into memory/cache problems).

I have a somewhat working code, but I need it to do a lot more still and I just can't figure it out, I don't know VB at all, just vague memories of C++ from years ago.

Right now it goes to an otherwise blank sheet, and inserts all the data. For whatever reason that I cannot figure out, whatever the QueryValue is, is placed above the data (which is needed) but then it puts _# after it as it goes, counting up with the counter, like I said I used code from a few places, and somewhere someone had that in it, but I am blind or something and can't see where that is coming from to get rid of it. I need it gone so that I can use an HLookup macro later to extract certain data from the querty based on the QueryValue.

Also, if ther is any way to make this query more effective, or look nicer, that would be appreciated too, but so far I am thinking I will just use it on a hidden tab, and then extract certain data from the query to display on another tab along with other information.

Thanks for the help!

Here is the code I have so far, I modified it from code I found in various forums after search far too long.

Formula: copy to clipboard
Please Login or Register  to view this content.