|
伦敦奥运会奖牌榜_2012:
Sub 伦敦奥运会奖牌榜_2012()
Dim p As Shape
Set My = Worksheets(1)
For Each p In My.Shapes
If Not Application.Intersect(p.TopLeftCell, Cells) Is Nothing Then p.Delete
Next
Cells.Clear
On Error Resume Next
[a2:f2] = Split("排名,国家/地区,金牌,银牌,铜牌,总数", ",")
With CreateObject("internetexplorer.application")
.Visible = True
.Navigate "http://match.2012.sina.com.cn/medals/?c=spr_aoyun_sq_baidux_homepage_t00002"
Do Until .ReadyState = 4
DoEvents
Loop
Set r = .Document.All.tags("table")(0).All.tags("tr")
k = 2
For i = 1 To r.Length - 1 Step 4
k = k + 1
For j = 0 To r(i).Cells.Length - 1
Cells(k, j + 1) = r(i).Cells(j).innerText
Next j
Cells(k, "g").RowHeight = 13.5
Cells(k, "g").ColumnWidth = 2.25
ML = Cells(k, "g").Left
MT = Cells(k, "g").Top
MW = Cells(k, "g").Width
MH = Cells(k, "g").Height
Cells(k, "g").Select
ActiveSheet.Shapes.AddShape(msoShapeRectangle, ML, MT, MW, MH).Select
Selection.ShapeRange.Fill.UserPicture r(i).All.tags("img")(0).src
Selection.ShapeRange.Line.Visible = False
Next
Selection.ShapeRange.Delete
.Quit
End With
MsgBox "ok"
End Sub
|
|