Consulting

Results 1 to 2 of 2

Thread: Add Dynamic Option and loop to my code

  1. #1
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location

    Add Dynamic Option and loop to my code

    I have a VBA code that copy the data of the url like: http://www.mydomain.com/search.php?p...9&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.

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    [vba] 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 [/vba]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •