pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

VisualBasic pastebin - collaborative debugging tool View Help


Posted by zixyer on Wed 10 Dec 00:55
report abuse | download | new post

  1. Sub LoadZips()
  2.     Const ZIP_COLUMN As Integer = 1
  3.     Const OUTPUT_COLUMN As Integer = 2
  4.    
  5.     Dim ie
  6.     Set ie = CreateObject("InternetExplorer.Application")
  7.     ie.Visible = True
  8.    
  9.     ie.Navigate "http://www.zipinfo.com/search/zipcode.htm"
  10.     Do Until ie.ReadyState = 4 ' READYSTATE_COMPLETE
  11.         DoEvents
  12.     Loop
  13.    
  14.     For Each Cell In Selection
  15.         If Not ie.Document.Forms(0).tz.Checked Then
  16.             ie.Document.Forms(0).tz.Click
  17.         End If
  18.         ie.Document.Forms(0).zip.Value = Cells(Cell.Row, ZIP_COLUMN).Value
  19.         ie.Document.Forms(0).Go.Click
  20.         Do Until ie.Document.ReadyState = "complete"
  21.             DoEvents
  22.         Loop
  23.         Set tables = ie.Document.GetElementsByTagName("table")
  24.         Cells(Cell.Row, OUTPUT_COLUMN).Value = tables(3).Rows(1).Cells(3).innerText
  25.     Next Cell
  26. 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.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post