PDA

View Full Version : Add Dynamic Option and loop to my code



parscon
07-22-2013, 07:15 PM
I have a VBA code that copy the data of the url like: http://www.mydomain.com/search.php?pg=1&Type=Data&NO=1&DMID=829&dlr=1&LP=ELM And also paste on Sheet1 and copy them from sheet1 to sheet2 and delete the data in sheet1. Now the problem is in the loop, I have about 2400 web page and "pg=1" will be change in all url that mean pa=2 , pg=3 till pa=2400. Note: the dynamic section is “pg=1” So how can i add this option to my code that mean start from page one after finish start page two and continue till finish page 2400 . Thank you.

Kenneth Hobs
07-22-2013, 07:29 PM
Dim i As Integer, s As String
For i = 1 To 10
s = "http://www.mydomain.com/search.php?pg=" & i & "&Type=Data&NO=1&DMID=829&dlr=1&LP=ELM"
MsgBox s
Next i