0

I want to auto fetch data from various web pages of a single website . The link is the same but just the last number changes like this : http://reo-agents.net/agents/1 the link remains the same just the end number changes till 953157. As there are 953157 records total.

I just want to import the name, email & phone number and format it properly LIKE separate column for name ,email & cell phone . I just saw few tutorials on it and did a macro recording but was unable to get a working solution. Here is the macro for it

Sub Macro1()
'
' Macro1 Macro
'

'
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://reo-agents.net/agents/1", Destination:=Range("$A$1"))
        .Name = "1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
    ActiveWindow.SmallScroll Down:=21
End Sub

How do I automate this?

pnuts
  • 58,317
  • 11
  • 87
  • 139
  • What have you tried so far and what was the result. SO is about the question, so the notes about this being your first question are unnecessary. What format do you want, "properly" is not a good description. – AdrianHHH Aug 03 '13 at 07:48
  • I tried adding loops in it while watching some tutorials but I was not able to do so messed everything. Format is simple like separate column for name ,email and cellphone. Can you plz help me – Mohit Sharma Aug 03 '13 at 08:27
  • I asked what have you tried so far, I should have said to show us what you have tried. Seeing the code you have tried allows the topic experts to suggest corrections and improvements that will do the job and help your understanding. – AdrianHHH Aug 03 '13 at 10:37
  • I was not able to do anything just rubbing copy paste coding into my macro but nothing worked can any one help me out with this ?? – Mohit Sharma Aug 10 '13 at 10:17

0 Answers0