View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Norie Norie is offline
external usenet poster
 
Posts: 82
Default How do you importing unicode from web

You could try this.

Sub test()

Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.Navigate "http://www.fallingrain.com/world/FR/a/A/b/"
Do Until .ReadyState = 4: DoEvents: Loop

Set doc = IE.Document
GetOneTable doc, 2, Range("A1")
.Quit
End With
End Sub

Sub GetOneTable(d, n, rngDst As Range)
' d is the document
' n is the table to extract


Dim e As Object ' the elements of the document
Dim t As Object ' the table required
Dim r As Object ' the rows of the table
Dim c As Object ' the cells of the rows.
Dim I As Long
Dim J As Long

For Each e In d.all

If e.nodename = "TABLE" Then
J = J + 1
End If

If J = n Then
Set t = e

tabno = tabno + 1

For Each r In t.Rows
For Each c In r.Cells
rngDst.Value = c.innertext
Set rngDst = rngDst.Offset(, 1)

Next c

Set rngDst = rngDst.Offset(1, -rngDst.Column + 1)
Next r

Exit For

End If

Next e

End Sub