title: Search a website with Excel data to extract results and then loop
body: <p>I have 8000 values in an Excel spreadsheet.</p>
  <p>I need to search a website and then record a specific line of data from the website to in the Excel spreadsheet.<br />
  <a href="https://i.stack.imgur.com/tXv1q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tXv1q.png" alt="enter image description here" /></a></p>
  <p>I found code which searches for data <a href="https://stackoverflow.com/questions/13682639/excel-macro-to-search-a-website-and-extract-results">excel macro to search a website and extract results</a></p>
  <pre><code>Sub URL_Get_ABN_Query()
      strSearch = Range(&quot;a1&quot;)
      With ActiveSheet.QueryTables.Add( _           
        Connection:=&quot;URL;http://www.abr.business.gov.au/SearchByABN.aspx?SearchText=&quot; &amp; _
        strSearch &amp; &quot;&amp;safe=active&quot;, _
        Destination:=Range(&quot;a5&quot;))
  
          .BackgroundQuery = True
          .TablesOnlyFromHTML = True
          .Refresh BackgroundQuery:=False
          .SaveData = True
      End With
      'enter code here
  End Sub
  </code></pre>
  <p>It collects the data from the website like this.<br />
  <a href="https://i.stack.imgur.com/hQebY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hQebY.png" alt="enter image description here" /></a></p>
  <p>I only want the 'entity type' data line.</p>
  <p>I can not find how to extend the code to only grab this line and input to the corresponding cell. i.e. ABN(b2)search, find input 'entity type' and paste into Company Type(c2).</p>
  <p>Alternatively, I tried to find how to fill the information vertically instead of horizontally. I could delete the columns that are not needed. I thought this may be simpler.</p>
  <p>I tried to record the macro with developer.</p>
  <p>I also need to loop to the next ABN and populate the corresponding field and so on (B3&gt;C3, B4&gt;C4, etc.).</p>