Posted by zixyer on Wed 10 Dec 00:55
report abuse | download | new post
- Sub LoadZips()
- Const ZIP_COLUMN As Integer = 1
- Const OUTPUT_COLUMN As Integer = 2
- Dim ie
- Set ie = CreateObject("InternetExplorer.Application")
- ie.Visible = True
- ie.Navigate "http://www.zipinfo.com/search/zipcode.htm"
- Do Until ie.ReadyState = 4 ' READYSTATE_COMPLETE
- DoEvents
- Loop
- For Each Cell In Selection
- If Not ie.Document.Forms(0).tz.Checked Then
- ie.Document.Forms(0).tz.Click
- End If
- ie.Document.Forms(0).zip.Value = Cells(Cell.Row, ZIP_COLUMN).Value
- ie.Document.Forms(0).Go.Click
- Do Until ie.Document.ReadyState = "complete"
- DoEvents
- Loop
- Set tables = ie.Document.GetElementsByTagName("table")
- Cells(Cell.Row, OUTPUT_COLUMN).Value = tables(3).Rows(1).Cells(3).innerText
- Next Cell
- End Sub
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.