Hello to anyone patient enough to help me with this issue. I have a list of addresses, Cities, and Zip codes. I need to enter these into the website and then press search. My VBA script so far covers the entering of address, city and zip code. However, I am lost on how to find the search button on the HTML Code. I have tried several different ways to find the search button and click. Those attempts are denoted "Problem area." Please view the VBA script. I could not post the HTML because it had too many links. The URL is as follows: mycpa.cpa.state.tx.us/atj/addresslookup.jsp. Please help me write a script to press search on this webpage. Thank you in advanced! Bonus! if you can help me loop searching values in E2:F2:G2-E8000:F8000:G8000 on the list of addresses, cities, and zip code.



Sub Test123()



Dim eRow As Long
Dim ele As Object
Dim i As Long


Set sht = Sheets("sheet1")
RowCount = 1
sht.Range("A" & RowCount) = "City"
sht.Range("B" & RowCount) = "County"
sht.Range("C" & RowCount) = "MTA"
sht.Range("D" & RowCount) = "SPD"


eRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Set Objie = CreateObject("InternetExplorer.Application")




myaddress = Sheets("sheet1").Range("E2")
mycity = Sheets("sheet1").Range("F2")
myzip = Sheets("sheet1").Range("G2")



With Objie
.Visible = True
.navigate "mycpa.cpa.state.tx.us/atj/addresslookup.jsp"


Do While .Busy Or _
.readystate <> 4
DoEvents
Loop


Set what = .document.getElementsByname("address")
what.Item(0).Value = myaddress


Set address1 = .document.getElementsByname("city")
address1.Item(0).Value = mycity


Set zipcode1 = .document.getElementsByname("zipCode")
zipcode1.Item(0).Value = myzip



'SendKeys "{enter}"
'.navigate
.document.forms ["addressLookupForm"].submit()




Do While .Busy Or _
.readystate <> 4
DoEvents
Loop


For Each ele In .document.all
Select Case ele.classname
Case "Result"
RowCount = RowCount + 1
Case "Title"
sht.Range("A" & RowCount) = ele.innertext
Case "Company"
sht.Range("B" & RowCount) = ele.innertext
Case "Location"
sht.Range("C" & RowCount) = ele.innertext
Case "Description"
sht.Range("D" & RowCount) = ele.innertext


End Select
Next ele


End With


Set Objie = Nothing


End Sub