I am trying to get property tax values for about 200 properties. The info is publicly available on this site:
http://www.hawaiipropertytax.com/Searc/GenericSearch.aspx?mode=PARID
I have a list of Parcel IDs (also known as TMK Value) that identify properties in a spreadsheet. Here are just two for testing
750100600000
640190140000
Now, the first time you run my macro, it will stop because there is a disclosure that shows up. After you accept it once, you will not be prompt again. I assumed that I have accepted that, so I don't have to deal with that step in my macro, but you may have to accept the disclosure once, then resume the macro during testing.
OK. I have a spreadsheet with Parcel IDs. My macro selects the first one, then goes to the site above, inputs the value in the search box and clicks the search button. Then, the results load. I want to click on the first line of results, but I have been unsuccessful. I have used sendkeys before, but this time it is not working. I need help making that click. Assuming I can get pass that, it would take me to another page, where I want to click on the left hand side menu called "Values - 2011 Assessment Year". After that loads, I want to bring into excel the row displaying the "Parcel Summary Totals". Any help is appreciated.
Here is what I have so far.
Sub Tax_Property_Value_Grabber()
Dim ie As Object, lLastRow As Integer, i As Integer, TMKValue As String
Set ie = CreateObject("InternetExplorer.Application")
Sheets("TMK").Select
TMKValue = Range("P4").Value
lLastRow = 200
Start_Row = 4
For i = Start_Row To lLastRow
ie.Visible = True
ie.navigate "http://www.hawaiipropertytax.com/Search/GenericSearch.aspx?mode=PARID"
Do While ie.busy: DoEvents: Loop
Do While ie.ReadyState <> 4: DoEvents: Loop
ie.Document.all.Item("inpParid").Value = TMKValue
ie.Document.all.Item("btSearch").Click
Do While ie.busy: DoEvents: Loop
Do While ie.ReadyState <> 4: DoEvents: Loop
With ie.Visible = True
ie.Document.all.Item("inpParid").Select
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{ENTER}", True
End With
Do While ie.busy: DoEvents: Loop
Do While ie.ReadyState <> 4: DoEvents: Loop
ie.Document.all.Item("Values - 2011 Assessment Year").Click
Do While ie.busy: DoEvents: Loop
Do While ie.ReadyState <> 4: DoEvents: Loop
' Not sure how to just copy the Parcel Summary Totals line only, but I am willing to copy the whole thing in a separate tab and then write something else to clean it up and bring it over
Next
End Sub
http://www.hawaiipropertytax.com/Searc/GenericSearch.aspx?mode=PARID
I have a list of Parcel IDs (also known as TMK Value) that identify properties in a spreadsheet. Here are just two for testing
750100600000
640190140000
Now, the first time you run my macro, it will stop because there is a disclosure that shows up. After you accept it once, you will not be prompt again. I assumed that I have accepted that, so I don't have to deal with that step in my macro, but you may have to accept the disclosure once, then resume the macro during testing.
OK. I have a spreadsheet with Parcel IDs. My macro selects the first one, then goes to the site above, inputs the value in the search box and clicks the search button. Then, the results load. I want to click on the first line of results, but I have been unsuccessful. I have used sendkeys before, but this time it is not working. I need help making that click. Assuming I can get pass that, it would take me to another page, where I want to click on the left hand side menu called "Values - 2011 Assessment Year". After that loads, I want to bring into excel the row displaying the "Parcel Summary Totals". Any help is appreciated.
Here is what I have so far.
Sub Tax_Property_Value_Grabber()
Dim ie As Object, lLastRow As Integer, i As Integer, TMKValue As String
Set ie = CreateObject("InternetExplorer.Application")
Sheets("TMK").Select
TMKValue = Range("P4").Value
lLastRow = 200
Start_Row = 4
For i = Start_Row To lLastRow
ie.Visible = True
ie.navigate "http://www.hawaiipropertytax.com/Search/GenericSearch.aspx?mode=PARID"
Do While ie.busy: DoEvents: Loop
Do While ie.ReadyState <> 4: DoEvents: Loop
ie.Document.all.Item("inpParid").Value = TMKValue
ie.Document.all.Item("btSearch").Click
Do While ie.busy: DoEvents: Loop
Do While ie.ReadyState <> 4: DoEvents: Loop
With ie.Visible = True
ie.Document.all.Item("inpParid").Select
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{ENTER}", True
End With
Do While ie.busy: DoEvents: Loop
Do While ie.ReadyState <> 4: DoEvents: Loop
ie.Document.all.Item("Values - 2011 Assessment Year").Click
Do While ie.busy: DoEvents: Loop
Do While ie.ReadyState <> 4: DoEvents: Loop
' Not sure how to just copy the Parcel Summary Totals line only, but I am willing to copy the whole thing in a separate tab and then write something else to clean it up and bring it over
Next
End Sub
Last edited: