Sub TSBPA_Search_Bot()
Dim http As New XMLHTTP60
Dim html As New HTMLDocument
Dim posts As Object
Dim elem As Object
Dim trow As Object
Dim cel As Range
Dim poststr As String
Dim lrow As Long
Dim x As Long
Dim y As Long
Sheet2.Cells.ClearContents
lrow = Sheet1.Range("A" & Rows.Count).End(xlUp).row
For Each cel In Sheet1.Range("A2:A" & lrow)
poststr = "LICID=&LNAME=" & cel & "&FNAME=" & cel.Offset(, 1) & "&CLNAME=&CITY=&CNTY=&STATE=&ZIP=&submit=Submit+Search&tsbpa5a5a713dd8e59=tsbpa5a5a713dd8e59&list=fromsel"
With http
.Open "POST", "http://www.tsbpa.state.tx.us/php/fpl/indlookup.php", False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.setRequestHeader "User-Agent", "Mozilla/5.0"
.send poststr
html.body.innerHTML = .responseText
End With
Set posts = html.getElementById("results")
If Not posts Is Nothing Then
Sheet2.Cells(x + 1, 1) = cel
Sheet2.Cells(x + 1, 2) = cel.Offset(, 1)
For Each elem In posts.Rows
For Each trow In elem.Cells
y = y + 1: Sheet2.Cells(x + 1, y + 2) = trow.innerText
Next trow
y = 0: x = x + 1
Next elem
End If
Next cel
End Sub