title: Fetching data from website error
body: <pre><code>Sub GetDataFromLandings()
      Dim lastrow As Long, x As Long
  
      Application.ScreenUpdating = False
  
      ActiveWorkbook.Sheets("Sheet2").Range("A2:F250") = Null
  
      With Worksheets("Sheet2")
          lastrow = .Range("G" &amp; Rows.Count).End(xlUp).Row
  
          For x = 2 To lastrow
              RequeryLandings .Cells(x, "G")
          Next
      End With
      Application.ScreenUpdating = True
  End Sub
  
  Sub RequeryLandings(address As String)
      Dim ws As Worksheet
      Dim NewRow As Long
  
      With Worksheets("Sheet2")
  
          Set ws = ActiveWorkbook.Sheets("Sheet1")
  
          With ws.QueryTables.Add(Connection:= _
          "URL;https://www.flightradar24.com/data/aircraft/" &amp; address, _
          Destination:=ws.Range("$A$1"))
              .Name = "NNum_Results.aspx?NNumbertxt=22NA"
              .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
  
              DoEvents
  </code></pre>
  
  <p>Above code gets data from website <a href="https://www.flightradar24.com/data/aircraft/" rel="nofollow">https://www.flightradar24.com/data/aircraft/</a></p>
  
  <p>and loops through different values taken from column G :  </p>
  
  <pre><code>RequeryLandings .Cells(x, "G")
  </code></pre>
  
  <p>so URL address is in this form </p>
  
  <pre><code>"URL;https://www.flightradar24.com/data/aircraft/" &amp; address,
  </code></pre>
  
  <p>where   &amp; address    is the values from column G.</p>
  
  <p>If the first row in G column is <em>SP-LRC</em> then it searches URL</p>
  
  <pre><code>"URL;https://www.flightradar24.com/data/aircraft/SP-LRC"
  </code></pre>
  
  <p>I am trying to get data from different website which is </p>
  
  <p><a href="http://www.airliners.net/search?registrationActual=SP-LRC&amp;display=detail" rel="nofollow">http://www.airliners.net/search?registrationActual=SP-LRC&amp;display=detail</a></p>
  
  <p>and I can not figure out how the code should change to properly work for that address...in this case <code>SP-LRC</code> is not in the end of address but is before <code>&amp;display=detail</code></p>