回復 5#yanto913
https://sites.google.com/site/yanto913/home/page 可以直接 下載了 可是Ex 程序又要修改
會出現系統錯誤 加上下三列紅色的程式碼 修正
Sub Ex()
Dim ie As New InternetExplorer, Rng As Range, i, ii, s
Set Rng = ActiveSheet.[A1]
With ie
.Navigate ("https://sites.google.com/site/yanto913/home/page")
Do While .Busy = True
Loop
DoEvents
Set Rng = ActiveSheet.[A1]
For i = 0 To .Document.all.Length - 1
If .Document.all(i).tagName = "TD" And Len(.Document.all(i).innerText) > 0 And Len(.Document.all(i).innerText) <= 20 Then
Rng.Value = .Document.all(i).innerText
If .Document.all(i).innerText = "評語" Then
Set Rng = ActiveSheet.[A2]
Else
Set Rng = Rng.Offset(, 1)
End If
End If
If .Document.all(i).tagName = "A" Then
If .Document.all(i).Title Like "*國文*" Then
s = Split(.Document.all(i).Title, " ")
For ii = 0 To UBound(s)
ActiveSheet.Cells(1, 5 + ii).Resize(2) = Application.Transpose(Split(s(ii), ":"))
Next
End If
End If
Next
.Quit
End With
End Sub作者: yanto913 時間: 2010-10-11 23:10