Web Query - Use cell reference in web address

leeksleeks

Board Regular
Joined
Oct 31, 2013
Messages
96
Hi,

I was wondering if anyone could help with this query. I have a worksheet that imports data from a website using a simple web query import. The thing is there are 3 different sections of the web address that I would like vba to replace each time based on text that is in Cells A2, B2 and D2.

For example:[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]A2[/TD]
[TD="align: center"]B2[/TD]
[TD="align: center"]C2[/TD]
[TD="align: center"]D2[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]Apples[/TD]
[TD="align: center"]Bananas[/TD]
[TD="align: center"]Blank[/TD]
[TD="align: center"]Plums[/TD]
[/TR]
[TR]
[TD="align: center"]Grapes[/TD]
[TD="align: center"]Lemons[/TD]
[TD="align: center"]Blank[/TD]
[TD="align: center"]Oranges[/TD]
[/TR]
</tbody>[/TABLE]

The web query that it imports the data from is like the address below:

www.fruit.com/apples/bananas/plums

So what I would like the code to do is that once it has finished importing the data from the above web address, I would then like it to move onto the next query using Grapes/Lemons/Oranges which are in cells B2,C2,D2 and so on and so on.

I would like this to continue to loop through a worksheet called "Data" until there is no fruit left.

Is this possible? I thank you in advance. I dont have a fruit addiction fyi.......

Cheers!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,223,711
Messages
6,174,029
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top