VBA webquery

martiano

New Member
Joined
Oct 30, 2010
Messages
11
Hello,

In this document, I have URLs in Sheet1.

If you run the Macro, you will see that this Macro always takes data from URLs wha are in sheet1 and paste it to sheet3.

Than from sheet3 takes data from cell A11 and put it to the cells in column B in sheet1.

Macro runs perfect, but I want to cahnge one thing.

I dont want to past from sheet3 to sheet1 just cell A11, but all cells from cell A11 to cell C50 (A11, B11, C11, A12, B12, C12, A13 .......................... C49, A50, B50, C50) and past it in sheet1 to cells in same row.


Example:

In sheet1 cell A2 is this URL:
<TABLE style="WIDTH: 704pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=938><COLGROUP><COL style="WIDTH: 704pt; mso-width-source: userset; mso-width-alt: 34304" width=938><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #ece9d8; BORDER-LEFT: #ece9d8; BACKGROUND-COLOR: transparent; WIDTH: 704pt; HEIGHT: 15pt; BORDER-TOP: #ece9d8; BORDER-RIGHT: #ece9d8" class=xl65 height=20 width=938>http://pokec.azet.sk/sluzby/pouzivatelia/test2011/?pohlavie=2&vekOd=25&vekDo=25&region=11&pg=1&order=9&c=743&v=1&f=1&i9=ea0f73f44658

Now I would like to have pasted data from Sheet3 to Sheet1 like this:
From sheet3 A11 to sheet1 B12
From sheet3 B11 to sheet1 C12
From sheet3 C11 to sheet1 D12
From sheet3 A12 to sheet1 E12
From sheet3 B12 to sheet1 F12
From sheet3 C12 to sheet1 G12
From sheet3 A13 to sheet1 H12
From sheet3 B13 to sheet1 I12

.
.
.
.
</TD></TR></TBODY></TABLE>
From sheet3 B49 to sheet1 DM12
From sheet3 C49 to sheet1 DN12
From sheet3 A50 to sheet1 DO12
From sheet3 B50 to sheet1 DP12
From sheet3 C50 to sheet1 DQ12

If this is done the macro will follow to the next URL in next row. Macro will run all URLs what are in Column A (not strictly 11).

That is all.

Warning!
Before you will run this Macro, you need to log in to this website through web query. Follow this steps:
- go to sheet2
- Klick on Data, then on From Web
- to the address field past this link http://www.pokec.sk and press go
- to the first fild (username) type test2011 to the second field (password) type test2011 and press on the button Prihlasit
- thats it, now you are logged in

Thank you
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,224,551
Messages
6,179,470
Members
452,915
Latest member
hannnahheileen

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